-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder.sh
More file actions
51 lines (44 loc) · 1.78 KB
/
builder.sh
File metadata and controls
51 lines (44 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
APP=powershell
mkdir -p tmp && cd ./tmp || exit 1
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool || exit 1
chmod a+x ./appimagetool
URL=$(curl -Ls https://api.github.com/repos/PowerShell/PowerShell/releases/latest | grep -w -v i386 | grep -w -v i686 | grep -w -v aarch64 | grep -w -v arm64 | grep -w -v armv7l | grep browser_download_url | grep -i "linux-x64.tar.gz" | cut -d '"' -f 4 | head -1)
VERSION=$(curl -Ls https://api.github.com/repos/PowerShell/PowerShell/releases/latest | grep tag_name | head -1 | cut -d '"' -f 4)
wget "$URL" || exit 1
mkdir -p "$APP".AppDir
tar fx ./*tar* -C ./"$APP".AppDir/
for f in ./"$APP".AppDir/*; do
file "$f" | grep -q "dynamic\|static" && chmod a+x "$f"
done
echo "[Desktop Entry]
Categories=ConsoleOnly;System
Comment[en_US]=PowerShell Core
Comment[it_IT]=PowerShell Core
Comment=PowerShell Core
Exec=AppRun
GenericName[en_US]=Powershell
GenericName=Powershell
Icon=Powershell_256
MimeType=
Name=PowerShell
StartupNotify=true
Terminal=true
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=" >> ./"$APP".AppDir/"$APP".desktop
wget https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_256.png -O ./"$APP".AppDir/Powershell_256.png
cat >> ./"$APP".AppDir/AppRun << 'EOF'
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export UNION_PRELOAD="${HERE}"
exec "${HERE}"/pwsh "$@"
EOF
chmod a+x ./"$APP".AppDir/AppRun
ARCH=x86_64 ./appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \
-u "gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|PowerShell-appimage|continuous|*x86_64.AppImage.zsync" \
./"$APP".AppDir PowerShell-"$VERSION"-x86_64.AppImage || exit 1
cd ..
mv ./tmp/*.AppImage* ./