- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShell Script.xml
More file actions
Latest commit
116 lines (116 loc) · 8.3 KB
/
Copy pathShell Script.xml
File metadata and controls
116 lines (116 loc) · 8.3 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<templateSetgroup="Shell Script">
<templatename="fori"value="for $INDEX$ in $LOOP_ITEMS$ ; do $END$$SELECTION$ done"description="For loop in list"toReformat="true"toShortenFQNames="false">
<variablename="INDEX"expression=""defaultValue=""i""alwaysStopAt="true" />
<variablename="LOOP_ITEMS"expression=""defaultValue=""{1..5}""alwaysStopAt="true" />
<context />
</template>
<templatename="cmd"value="`$COMMAND$`"description="Command substitution"toReformat="false"toShortenFQNames="false">
<variablename="COMMAND"expression=""defaultValue=""command""alwaysStopAt="true" />
<context />
</template>
<templatename="cmd success check"value="if [[ $? == 0 ]]; then echo "Succeed"$END$ else echo "Failed" fi"description="Cmd success check"toReformat="true"toShortenFQNames="false">
<context />
</template>
<templatename="tar compress"value="tar -czvf $ARCHIVE$.tar.gz $DIRECTORY$"description="tar compress"toReformat="false"toShortenFQNames="false">
<variablename="ARCHIVE"expression=""defaultValue=""/path/to/archive""alwaysStopAt="true" />
<variablename="DIRECTORY"expression=""defaultValue=""/path/to/directory""alwaysStopAt="true" />
<context />
</template>
<templatename="tar decompress"value="tar -C $DIRECTORY$ -xzvf $ARCHIVE$.tar.gz"description="tar decompress"toReformat="false"toShortenFQNames="false">
<variablename="DIRECTORY"expression=""defaultValue=""/extract/to/path""alwaysStopAt="true" />
<variablename="ARCHIVE"expression=""defaultValue=""/path/to/archive""alwaysStopAt="true" />
<context />
</template>
<templatename="mkdir"value="mkdir "$DIRECTORY$""description="Create directory"toReformat="false"toShortenFQNames="false">
<variablename="DIRECTORY"expression=""defaultValue=""dirname""alwaysStopAt="true" />
<context />
</template>
<templatename="git branch create"value="git checkout -b $BRANCH$"description="Create branch"toReformat="false"toShortenFQNames="false">
<variablename="BRANCH"expression=""defaultValue=""branch_name""alwaysStopAt="true" />
<context />
</template>
<templatename="git push"value="git push origin $BRANCH$"description="Push branch to remote"toReformat="false"toShortenFQNames="false">
<variablename="BRANCH"expression=""defaultValue=""branch_name""alwaysStopAt="true" />
<context />
</template>
<templatename="git commit"value="git commit -m "$MESSAGE$""description="Commit changes"toReformat="false"toShortenFQNames="false">
<variablename="MESSAGE"expression=""defaultValue=""commit_message""alwaysStopAt="true" />
<context />
</template>
<templatename="curl"value="curl --request $METHOD$ -sL \ --url '$URL$'\ --output '$FILE$'"description="Http request"toReformat="true"toShortenFQNames="false">
<variablename="METHOD"expression="enum("GET","POST","PUT","DELETE")"defaultValue=""alwaysStopAt="true" />
<variablename="URL"expression=""defaultValue=""http://example.com""alwaysStopAt="true" />
<variablename="FILE"expression=""defaultValue=""./path/to/file""alwaysStopAt="true" />
<context />
</template>
<templatename="rm"value="rm $PARAM$ $PATH$"description="Remove file or dir"toReformat="false"toShortenFQNames="false">
<variablename="PARAM"expression="enum("-f","-d")"defaultValue=""alwaysStopAt="true" />
<variablename="PATH"expression=""defaultValue=""./path/file""alwaysStopAt="true" />
<context />
</template>
<templatename="find"value="find $PATH$ -type $PARAM$ -name "$NAME$""description="Find file or directory"toReformat="false"toShortenFQNames="false">
<variablename="PATH"expression=""defaultValue=""./path""alwaysStopAt="true" />
<variablename="PARAM"expression="enum("f","d")"defaultValue=""alwaysStopAt="true" />
<variablename="NAME"expression=""defaultValue=""file_name""alwaysStopAt="true" />
<context />
</template>
<templatename="heredoc"value="<<EOF $TEXT$$END$ EOF"description="Multiline string"toReformat="true"toShortenFQNames="false">
<variablename="TEXT"expression=""defaultValue=""text""alwaysStopAt="true" />
<context />
</template>
<templatename="xargs"value=" | xargs $COMMAND$"description="Execute commands from standard input"toReformat="false"toShortenFQNames="false">
<variablename="COMMAND"expression=""defaultValue=""command""alwaysStopAt="true" />
<context />
</template>
<templatename="system info linux"value="lsb_release -a"description="Linux system information"toReformat="false"toShortenFQNames="false">
<context />
</template>
<templatename="system info mac"value="sw_vers"description="Mac OS system information"toReformat="false"toShortenFQNames="false">
<context />
</template>
<templatename="system kernel info"value="uname -a"description="Kernel information"toReformat="false"toShortenFQNames="false">
<context />
</template>
<templatename="array create"value="$ARRAY$=($ITEMS$) "description="Create array"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<variablename="ITEMS"expression=""defaultValue=""item1 item2 item3""alwaysStopAt="true" />
<context />
</template>
<templatename="array all"value="${$ARRAY$[@]} "description="All array elements"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<context />
</template>
<templatename="array at index"value="${$ARRAY$[$INDEX$]} "description="Elements at index"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<variablename="INDEX"expression=""defaultValue=""index""alwaysStopAt="true" />
<context />
</template>
<templatename="array length"value="${#$ARRAY$[@]} "description="Array length"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<context />
</template>
<templatename="array delete"value="unset $ARRAY$ "description="Delete array"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<context />
</template>
<templatename="array delete at"value="unset $ARRAY$[$INDEX$] "description="Delete from array"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<variablename="INDEX"expression=""defaultValue=""index""alwaysStopAt="true" />
<context />
</template>
<templatename="array set element"value="$ARRAY$[$INDEX$]=$VALUE$ "description="Array set element at index"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<variablename="INDEX"expression=""defaultValue=""index""alwaysStopAt="true" />
<variablename="VALUE"expression=""defaultValue=""value""alwaysStopAt="true" />
<context />
</template>
<templatename="array add"value="$ARRAY$+=($ITEM$) "description="Add new item to the end of array"toReformat="false"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<variablename="ITEM"expression=""defaultValue=""item""alwaysStopAt="true" />
<context />
</template>
<templatename="array iteration"value="for item in ${$ARRAY$[@]}; do echo "$item"$END$ done "description="Iterate through array"toReformat="true"toShortenFQNames="false">
<variablename="ARRAY"expression=""defaultValue=""myArray""alwaysStopAt="true" />
<context />
</template>
</templateSet>