-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsource.sh
52 lines (42 loc) · 871 Bytes
/
source.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
scmd="npx sls "
s-install () {
npm install -g npm@">=5.2.0"
npm install
}
s-deploy () {
eval $scmd deploy --verbose
}
s-info () {
eval $scmd info --verbose > INFO.md
more INFO.md
}
s-run () {
if [ -z "$2" ]; then
eval $scmd invoke local -f $1 -l
else
eval $scmd invoke local -f $1 -l --path $2
fi
}
s-run-remote () {
if [ -z "$2" ]; then
eval $scmd invoke -f $1 -l
else
eval $scmd invoke -f $1 -l --path $2
fi
}
s-remove () {
if [ -n "$ZSH_VERSION" ]; then
read "?Are you sure you want to continue?"
else
read -p "?Are you sure you want to continue?" prompt
fi
eval $scmd remove --verbose
}
s-logs () {
if [ -n "$2" ]; then
eval $scmd logs -f $1 -t --filter $2
else
eval $scmd logs -f $1 -t --startTime 1m
fi
}