forked from ivan-hc/MS-Edge-appimage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
microsoft-edge-builder.sh
60 lines (51 loc) · 2.19 KB
/
microsoft-edge-builder.sh
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
52
53
54
55
56
57
58
59
60
#!/bin/sh
APP=microsoft-edge
# TEMPORARY DIRECTORY
mkdir -p tmp
cd ./tmp || exit 1
# DOWNLOAD APPIMAGETOOL
if ! test -f ./appimagetool; then
wget -q "$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/"/ /g; s/ /\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$')" -O appimagetool
chmod a+x ./appimagetool
fi
# CREATE CHROME BROWSER APPIMAGES
_create_edge_appimage(){
if wget --version | head -1 | grep -q ' 1.'; then
wget -q --no-verbose --show-progress --progress=bar "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-$CHANNEL/$(curl -Ls https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-"$CHANNEL"/ | grep -Po '(?<=href=")[^"]*' | sort --version-sort | tail -1)"
else
wget "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-$CHANNEL/$(curl -Ls https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-"$CHANNEL"/ | grep -Po '(?<=href=")[^"]*' | sort --version-sort | tail -1)"
fi
ar x ./*.deb
tar xf ./data.tar.xz
mkdir "$APP".AppDir
mv ./opt/microsoft/msed*/* ./"$APP".AppDir/
mv ./usr/share/applications/*.desktop ./"$APP".AppDir/
if [ "$CHANNEL" = "stable" ]; then
cp ./"$APP".AppDir/"$APP" ./"$APP".AppDir/AppRun
cp ./"$APP".AppDir/*128.png ./"$APP".AppDir/"$APP".png
else
cp ./"$APP".AppDir/"$APP"-"$CHANNEL" ./"$APP".AppDir/AppRun
cp ./"$APP".AppDir/*128*png ./"$APP".AppDir/"$APP"-"$CHANNEL".png
fi
tar xf ./control.tar.xz
VERSION=$(cat control | grep Version | cut -c 10-)
ARCH=x86_64 VERSION=$(./appimagetool -v | grep -o '[[:digit:]]*') ./appimagetool -s ./"$APP".AppDir
mv ./*.AppImage ./Microsoft-Edge-"$CHANNEL"-"$VERSION"-x86_64.AppImage || exit 1
}
CHANNEL="stable"
mkdir -p "$CHANNEL" && cp ./appimagetool ./"$CHANNEL"/appimagetool && cd "$CHANNEL" || exit 1
_create_edge_appimage
cd ..
mv ./"$CHANNEL"/*.AppImage ./
CHANNEL="beta"
mkdir -p "$CHANNEL" && cp ./appimagetool ./"$CHANNEL"/appimagetool && cd "$CHANNEL" || exit 1
_create_edge_appimage
cd ..
mv ./"$CHANNEL"/*.AppImage ./
CHANNEL="dev"
mkdir -p "$CHANNEL" && cp ./appimagetool ./"$CHANNEL"/appimagetool && cd "$CHANNEL" || exit 1
_create_edge_appimage
cd ..
mv ./"$CHANNEL"/*.AppImage ./
cd ..
mv ./tmp/*.AppImage ./