Skip to content

Commit 7d85059

Browse files
committed
Fix a bug in the logic that checks if the script has already run today
Fix: sqlitebrowser#3868
1 parent 3c07690 commit 7d85059

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

installer/other/get_nightlies_from_github_actions.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ source /root/.gh_token_secure
88
set -ex
99

1010
echo "$(TZ=UTC date +"%Y-%m-%d %H:%M:%S %Z"): [START]"
11+
DATE=$(date +%Y%m%d)
1112
echo "Clear the incoming directory"
1213
DOWNLOAD_DIR="/tmp/incoming/"
1314
rm -rfv $DOWNLOAD_DIR
1415
mkdir -v $DOWNLOAD_DIR
1516

16-
if [ $(ls -l /nightlies/appimage /nightlies/appimage-arm64 /nightlies/win32 /nightlies/win64 /nightlies/macos-universal | grep -c "$(date +%Y%m%d)") ]; then
17+
if [ $(ls -l /nightlies/appimage /nightlies/appimage-arm64 | grep -c "$DATE") ] &&
18+
[ $(ls -l /nightlies/macos-universal | grep -c "$DATE") ] &&
19+
[ $(ls -l /nightlies/win32 /nightlies/win64 | grep -c "$DATE") -ne 0 ]; then
1720
echo "Nightly build already exists"
1821
exit 1
1922
fi
@@ -38,7 +41,7 @@ echo "Successfully downloaded the nightly build"
3841

3942
# Check if the downloaded files are as expected
4043
# This case is occuring when the nightly build is skipped
41-
if [ $(ls -l $DOWNLOAD_DIR | grep -c "$(date +%Y%m%d)") -ne 10 ]; then
44+
if [ $(ls -l $DOWNLOAD_DIR | grep -c "$DATE") -ne 10 ]; then
4245
echo "Last nightly build is skipped"
4346
exit 1
4447
fi
@@ -54,11 +57,10 @@ rm -v /nightlies/latest/*.dmg
5457
rm -v /nightlies/latest/*.msi
5558
rm -v /nightlies/latest/*.zip
5659

57-
DATE=$(date +%Y%m%d)
58-
ln -sv /nightlies/appimage/DB.Browser.for.SQLCipher-$(echo $DATE)-x86.64.AppImage /nightlies/latest/DB.Browser.for.SQLCipher-x86.64.AppImage
59-
ln -sv /nightlies/appimage/DB.Browser.for.SQLite-$(echo $DATE)-x86.64.AppImage /nightlies/latest/DB.Browser.for.SQLite-x86.64.AppImage
60-
ln -sv /nightlies/appimage-arm64/DB.Browser.for.SQLCipher-$(echo $DATE)-aarch64.AppImage /nightlies/latest/DB.Browser.for.SQLCipher-aarch64.AppImage
61-
ln -sv /nightlies/appimage-arm64/DB.Browser.for.SQLite-$(echo $DATE)-aarch64.AppImage /nightlies/latest/DB.Browser.for.SQLite-aarch64.AppImage
60+
ln -sv /nightlies/appimage/DB.Browser.for.SQLCipher-$DATE-x86.64.AppImage /nightlies/latest/DB.Browser.for.SQLCipher-x86.64.AppImage
61+
ln -sv /nightlies/appimage/DB.Browser.for.SQLite-$DATE-x86.64.AppImage /nightlies/latest/DB.Browser.for.SQLite-x86.64.AppImage
62+
ln -sv /nightlies/appimage-arm64/DB.Browser.for.SQLCipher-$DATE-aarch64.AppImage /nightlies/latest/DB.Browser.for.SQLCipher-aarch64.AppImage
63+
ln -sv /nightlies/appimage-arm64/DB.Browser.for.SQLite-$DATE-aarch64.AppImage /nightlies/latest/DB.Browser.for.SQLite-aarch64.AppImage
6264
ln -sv /nightlies/macos-universal/DB.Browser.for.SQLCipher-universal_$DATE.dmg /nightlies/latest/DB.Browser.for.SQLCipher-universal.dmg
6365
ln -sv /nightlies/macos-universal/DB.Browser.for.SQLite-universal_$DATE.dmg /nightlies/latest/DB.Browser.for.SQLite-universal.dmg
6466
ln -sv /nightlies/win32/DB.Browser.for.SQLite-$DATE-x86.msi /nightlies/latest/DB.Browser.for.SQLite-x86.msi

0 commit comments

Comments
 (0)