-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReDefineOne.GHA.sh
More file actions
executable file
·54 lines (44 loc) · 977 Bytes
/
ReDefineOne.GHA.sh
File metadata and controls
executable file
·54 lines (44 loc) · 977 Bytes
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
#!/bin/bash
set -eu
if (( $# >= 1 )); then
zip="$1"
dir="${zip%.*}/"
else
echo "[ERROR] File name missing"
exit 1
fi
if [[ ! -f "$zip" ]]; then
echo "[WARNING] File <$zip> does not exists"
exit
fi
echo "::group::${zip%.*}"
ok=1
./ReDefineOne.sh "${zip//\.\//}" || ok=0
echo "::endgroup::"
if [[ $ok -eq 0 ]]; then
echo "[WARNING] ReDefine script error"
if [[ -d "$dir" ]]; then
echo "[WARNING] Directory <$dir> reset"
git checkout -- "$dir" || true
fi
exit
fi
if [[ ! -d "$dir" ]]; then
echo "[WARNING] Directory <$dir> does not exists"
exit
fi
if [[ -z "${GHA_COMMIT+x}" ]]; then
gha="ReDefine.GHA.txt"
echo "[WARNING] GHA_COMMIT variable missing"
echo "[WARNING] Using default value <$gha>"
else
gha="$GHA_COMMIT"
fi
if [[ -n "$(git status --short --untracked-files=all "$dir")" ]]; then
git add "$dir"
echo "$dir : updated"
echo "- Updated $dir" >> $gha
else
echo "$dir : no changes"
fi
echo