2023-07-21 10:45:07 -04:00
|
|
|
#!/usr/bin/env bash
|
2021-06-05 19:47:16 -04:00
|
|
|
|
2021-09-09 04:18:22 -04:00
|
|
|
set -ex
|
|
|
|
|
|
|
|
CALLER_DIR=$( pwd )
|
|
|
|
|
|
|
|
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
2021-06-05 19:47:16 -04:00
|
|
|
|
2022-06-05 15:30:23 -04:00
|
|
|
if [[ "${VSCODE_ARCH}" == "x64" ]]; then
|
2022-09-26 05:42:26 -04:00
|
|
|
GITHUB_RESPONSE=$( curl --silent --location "https://api.github.com/repos/AppImage/pkg2appimage/releases/latest" )
|
2022-09-13 16:23:52 -04:00
|
|
|
APPIMAGE_URL=$( echo "${GITHUB_RESPONSE}" | jq --raw-output '.assets | map(select( .name | test("x86_64.AppImage(?!.zsync)"))) | map(.browser_download_url)[0]' )
|
|
|
|
|
|
|
|
if [[ -z "${APPIMAGE_URL}" ]]; then
|
|
|
|
echo "The url for pkg2appimage.AppImage hasn't been found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-07-21 10:45:07 -04:00
|
|
|
wget -c "${APPIMAGE_URL}" -o pkg2appimage.AppImage
|
2022-09-13 16:23:52 -04:00
|
|
|
|
2023-07-21 10:45:07 -04:00
|
|
|
chmod +x ./pkg2appimage.AppImage
|
2021-06-05 19:47:16 -04:00
|
|
|
|
2023-07-21 10:45:07 -04:00
|
|
|
./pkg2appimage.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir
|
2021-07-23 04:01:38 -04:00
|
|
|
|
|
|
|
# add update's url
|
2021-06-05 19:47:16 -04:00
|
|
|
sed -i 's/generate_type2_appimage/generate_type2_appimage -u "gh-releases-zsync|VSCodium|vscodium|latest|*.AppImage.zsync"/' pkg2appimage.AppDir/AppRun
|
|
|
|
|
2021-07-23 04:01:38 -04:00
|
|
|
# remove check so build in docker can succeed
|
|
|
|
sed -i 's/grep docker/# grep docker/' pkg2appimage.AppDir/usr/share/pkg2appimage/functions.sh
|
|
|
|
|
2022-08-29 09:13:25 -04:00
|
|
|
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
|
2022-08-30 07:55:17 -04:00
|
|
|
sed -i 's|@@NAME@@|VSCodium-Insiders|g' recipe.yml
|
2022-08-29 09:13:25 -04:00
|
|
|
sed -i 's|@@APPNAME@@|codium-insiders|g' recipe.yml
|
|
|
|
sed -i 's|@@ICON@@|vscodium-insiders|g' recipe.yml
|
|
|
|
else
|
|
|
|
sed -i 's|@@NAME@@|VSCodium|g' recipe.yml
|
|
|
|
sed -i 's|@@APPNAME@@|codium|g' recipe.yml
|
|
|
|
sed -i 's|@@ICON@@|vscodium|g' recipe.yml
|
|
|
|
fi
|
|
|
|
|
2021-09-09 04:18:22 -04:00
|
|
|
bash -ex pkg2appimage.AppDir/AppRun recipe.yml
|
2022-02-03 15:46:31 -05:00
|
|
|
|
2021-09-09 04:18:22 -04:00
|
|
|
rm -f pkg2appimage-*.AppImage
|
|
|
|
rm -rf pkg2appimage.AppDir
|
2022-08-29 15:56:51 -04:00
|
|
|
rm -rf VSCodium*
|
2020-10-16 21:20:13 -04:00
|
|
|
fi
|
2021-06-05 19:47:16 -04:00
|
|
|
|
2022-02-03 15:46:31 -05:00
|
|
|
cd "${CALLER_DIR}"
|