Skip to content

Commit f0e9791

Browse files
committed
Fix updates
1 parent a23be4a commit f0e9791

9 files changed

Lines changed: 30 additions & 34 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#!/bin/bash
12
curl -s https://api.github.com/repos/prismlauncher/PrismLauncher/releases/latest | grep ".AppImage\"" | grep "browser_download_url" | awk '{print $2}' | awk -F"/" '{print $8}' | tail -n1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
curl -s https://api.github.com/repos/microsoft/vscode/releases/latest | grep tag_name | awk '{print $2}' | sed 's/\"//g' | sed "s/,//"
2+
curl -s https://api.github.com/repos/microsoft/vscode/releases/latest | grep tag_name | awk '{print $2}' | sed 's/\"//g' | sed "s/,//"

apps/Better Scratch/install-x64

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION=
2-
GH_VERSION=1.4
3-
install_package https://github.com/betterscratch/desktop/releases/download/${GH_VERSION}/Better.Scratch-linux-amd64-${VERSION}.deb
1+
VERSION=1.4.0
2+
GH_VER=1.4
3+
install_package https://github.com/betterscratch/desktop/releases/download/${GH_VER}/Better.Scratch-linux-amd64-${VERSION}.deb

apps/Modrinth/install-x64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION=
1+
VERSION=0.10.10
22
install_package https://launcher-files.modrinth.com/${VERSION}/0.10.7/linux/Modrinth%20App_${VERSION}_amd64.deb

apps/Prism Launcher/install-x64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
VERSION=
2+
VERSION=9.4
33

44
mkdir $HOME/.local
55
cd $HOME/.local

apps/Visual Studio Code/install-32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION=
1+
VERSION=1.105.0
22
install_package https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-armhf

apps/Visual Studio Code/install-64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION=
1+
VERSION=1.105.0
22
install_package https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-arm64
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION=
1+
VERSION=1.105.0
22
install_package https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64

etc/tools/updates.sh

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,28 @@ for dir in "$APPS_DIR"/*/; do
88
folder_name=$(basename "$dir")
99
for install_file in "$dir"/install*; do
1010
[[ -f "$install_file" ]] || continue
11-
old_version=$(grep -E '^VERSION=' "$install_file" | cut -d'=' -f2 | sed 's/"//g')
12-
if [[ ! -z "$old_version" ]]; then
13-
workflow_script="$WORKFLOWS_DIR/$folder_name.sh"
14-
workflow_script=$(echo "$workflow_script" | tr ' ' '\ ')
11+
old_version=$(cat "$install_file" | grep 'VERSION=' | cut -d'=' -f2 | head -n1 | sed 's/"//g')
12+
workflow_script="$WORKFLOWS_DIR/$folder_name.sh"
13+
workflow_script=$(echo "$workflow_script" | tr ' ' '\ ')
1514

16-
if [ -e "$workflow_script" ]; then
17-
new_version=$(bash "$workflow_script" 2>/dev/null || echo "$old_version")
18-
else
19-
new_version="$old_version"
20-
fi
15+
if [ -e "$workflow_script" ]; then
16+
new_version=$(bash "$workflow_script" || echo "$old_version")
17+
else
18+
new_version="$old_version"
19+
fi
2120

22-
if [[ "$new_version" == "$old_version" ]]; then
23-
./api info "No update required for $folder_name"
24-
else
25-
./api info "$folder_name - $(basename "$install_file"): old version=$old_version, new version=$new_version"
26-
if [ ! -e updates_list.txt ]; then
27-
echo -n "$folder_name" >> updates_list.txt
28-
elif ! grep "$folder_name" updates_list.txt &>/dev/null; then
29-
echo -n ", $folder_name" >> updates_list.txt
30-
fi
31-
sed -i "s/VERSION=${old_version}/VERSION=${new_version}/" "$install_file"
32-
sed -i "s/VERSION=\"$old_version\"/VERSION=\"$new_version\"/" "$install_file"
21+
if [[ "$new_version" == "$old_version" ]]; then
22+
./api info "$folder_name - $(basename "$install_file"): old version=$old_version, new version=$new_version"
23+
./api info "No update required for $folder_name"
24+
else
25+
./api info "$folder_name - $(basename "$install_file"): old version=$old_version, new version=$new_version"
26+
if [ ! -e updates_list.txt ]; then
27+
echo -n "$folder_name" >> updates_list.txt
28+
elif ! grep "$folder_name" updates_list.txt &>/dev/null; then
29+
echo -n ", $folder_name" >> updates_list.txt
3330
fi
31+
sed -i "s/VERSION=${old_version}/VERSION=${new_version}/" "$install_file"
32+
sed -i "s/VERSION=\"$old_version\"/VERSION=\"$new_version\"/" "$install_file"
3433
fi
3534
done
36-
done
37-
38-
curl -s https://api.github.com/repos/microsoft/vscode/releases/latest
39-
curl -s https://api.github.com/repos/betterscratch/desktop/releases/latest
40-
curl -s https://api.github.com/repos/modrinth/code/releases/latest
35+
done

0 commit comments

Comments
 (0)