vscodium/build/linux/appimage/build.sh

48 lines
1.5 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -ex
CALLER_DIR=$( pwd )
cd "$( dirname "${BASH_SOURCE[0]}" )"
if [[ "${VSCODE_ARCH}" == "x64" ]]; then
2022-09-26 12:42:26 +03:00
GITHUB_RESPONSE=$( curl --silent --location "https://api.github.com/repos/AppImage/pkg2appimage/releases/latest" )
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
wget -c "${APPIMAGE_URL}" -O pkg2appimage.AppImage
2023-07-23 19:35:27 +03:00
chmod +x ./pkg2appimage.AppImage
2023-07-23 19:35:27 +03:00
./pkg2appimage.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir
# add update's url
sed -i 's/generate_type2_appimage/generate_type2_appimage -u "gh-releases-zsync|VSCodium|vscodium|latest|*.AppImage.zsync"/' pkg2appimage.AppDir/AppRun
# 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 16:13:25 +03:00
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
sed -i 's|@@NAME@@|VSCodium-Insiders|g' recipe.yml
2022-08-29 16:13:25 +03: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
bash -ex pkg2appimage.AppDir/AppRun recipe.yml
2022-02-03 23:46:31 +03:00
rm -f pkg2appimage-*.AppImage
rm -rf pkg2appimage.AppDir
2022-08-29 22:56:51 +03:00
rm -rf VSCodium*
2020-10-17 04:20:13 +03:00
fi
2022-02-03 23:46:31 +03:00
cd "${CALLER_DIR}"