fix(bundler): build AppDir in the cache folder so the appimage works
@@ -15,8 +15,14 @@ else
linuxdeploy_arch="$ARCH"
fi
+OUTDIR="${PWD}"
+
+cd "{{tauri_tools_path}}"
+
+# remove the folder if it exists - the rest of the script fails if it does
+rm -rf "{{app_name}}.AppDir"
mkdir -p "{{app_name}}.AppDir"
-cp -r ../appimage_deb/data/usr "{{app_name}}.AppDir"
+cp -r "${OUTDIR}/../appimage_deb/data/usr" "{{app_name}}.AppDir"
cd "{{app_name}}.AppDir"
@@ -35,8 +41,8 @@ find /usr/lib* -name WebKitNetworkProcess -exec mkdir -p "$(dirname '{}')" \; -e
find /usr/lib* -name WebKitWebProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
find /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
-wget -q -4 -N -O "{{tauri_tools_path}}/AppRun" https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N -O "{{tauri_tools_path}}/AppRun" https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH}
-chmod +x "{{tauri_tools_path}}/AppRun"
+wget -q -4 -N -O AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N -O AppRun https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH}
+chmod +x AppRun
cp "{{icon_path}}" .DirIcon
ln -s "{{icon_path}}" "{{app_name}}.png"
@@ -45,10 +51,12 @@ ln -s "usr/share/applications/{{app_name}}.desktop" "{{app_name}}.desktop"
cd ..
-wget -q -4 -N -O "{{tauri_tools_path}}/linuxdeploy-plugin-gtk.sh" "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
-wget -q -4 -N -O "{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${linuxdeploy_arch}.AppImage
+wget -q -4 -N -O linuxdeploy-plugin-gtk.sh "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
+wget -q -4 -N -O linuxdeploy-${ARCH}.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${linuxdeploy_arch}.AppImage
-chmod +x "{{tauri_tools_path}}/linuxdeploy-plugin-gtk.sh"
-chmod +x "{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage"
+chmod +x linuxdeploy-plugin-gtk.sh
+chmod +x linuxdeploy-${ARCH}.AppImage
-OUTPUT="{{appimage_filename}}" "{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage" --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk --output appimage
+OUTPUT="{{appimage_filename}}" ./linuxdeploy-${ARCH}.AppImage --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk --output appimage
+rm -r "{{app_name}}.AppDir"
+mv "{{appimage_filename}}" $OUTDIR
