forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegration.sh
executable file
·52 lines (41 loc) · 1.07 KB
/
integration.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
52
#!/bin/bash
function commit_documentation() {
if `git status | grep -q "nothing to commit"`; then
exit 0;
else
extensions=false
readme=false
extensions_path="commands/extensions.json"
readme_path="commands/README.md"
while read -r file; do
if [[ $file == $extensions_path ]]; then
extensions=true
fi
if [[ $file == $readme_path ]]; then
readme=true
fi
done <<< "$(git diff --name-only)"
if $extensions && $readme; then
git add $extensions_path $readme_path
git commit -m "Update Script Commands documentation"
fi
exit 0;
fi
}
function commit_executable() {
if `git status | grep -q "nothing to commit"`; then
exit 0;
else
git add -u
git commit -m "Set scripts as executable"
exit 0;
fi
}
argument=$1
git config --local user.email "bot@raycast.com"
git config --local user.name "Raycast Bot"
if [[ $argument = "commit_documentation" ]]; then
commit_documentation;
elif [[ $argument = "commit_executable" ]]; then
commit_executable;
fi