Skip to content

Commit b52401e

Browse files
committed
[skip ci] [Pustaka Script] use git retval instead
1 parent 698f5a5 commit b52401e

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

scripts/pustaka.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,25 @@ update_region() {
6060
echo "Updating $region..."
6161
echo "Ensure temp directory..."
6262
echo "XMFKILLA_REF_ASB_PATH is set to $XMFKILLA_REF_ASB_PATH"
63-
mkdir -p $XMFKILLA_REF_ASB_PATH
64-
echo "Running command: $program "$region" "$pustaka_dir" "$json" $2 $3 $4"
63+
mkdir -p "$XMFKILLA_REF_ASB_PATH"
64+
65+
echo "Running command: $program \"$region\" \"$pustaka_dir\" \"$json\" $2 $3 $4"
6566
$program "$region" "$pustaka_dir" "$json" $2 $3 $4
66-
retval=$?
67-
case $retval in
68-
0) echo "No changes on $region, skipping...";;
69-
1)
70-
echo "Changes detected for $region!"
71-
git add .
72-
git commit -m "Update pustaka for $region @$timestamp"
73-
git push origin-ssh
74-
;;
75-
-2147483648) echo "Error occurred for $region, skipping...";;
76-
*) echo "Unexpected return value $retval for $region";;
77-
esac
67+
68+
# Check if there are any staged or unstaged changes
69+
if [[ -n $(git status --porcelain) ]]; then
70+
echo "Changes detected for $region!"
71+
git add .
72+
git commit -m "Update pustaka for $region @$timestamp"
73+
git push origin-ssh
74+
else
75+
echo "No changes on $region, skipping..."
76+
fi
77+
7878
echo
7979
}
8080

81+
8182
# Update all regions
8283
update_region "Hi3SEA" "" "" ""
8384
update_region "Hi3Global" "" "" ""

0 commit comments

Comments
 (0)