forked from mmtrt/WINE_AppImage
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfetch.sh
executable file
·66 lines (51 loc) · 1.77 KB
/
fetch.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
61
62
63
64
65
66
#!/usr/bin/env bash
######################################################################
# @author : Ruan E. Formigoni ([email protected])
# @file : fetch.sh
######################################################################
set -e
if [ "$2" = "--version" ]; then
case "$1" in
"ge") curl -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases 2>&1 |
pcregrep -io "https://.*/download/.*\.tar(\.xz|\.xz)" |
sort --sort=version |
tail -n1 |
pcregrep -io1 "https://.*/download/.*/.*Proton(.*)-x86.*" ;;
*) curl -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/bottlesdevs/wine/releases 2>&1 |
pcregrep -io1 "https://.*/download/.*/$1-(.*)-" |
sed -e '/cx/d' |
sort --sort=version |
tail -n1 ;;
esac
exit
fi
[ "$1" ] || exit 1
case "$1" in
"ge") runner="$(curl -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases 2>&1 |
pcregrep -io "https://.*/download/.*\.tar(\.xz|\.xz)" |
sort --sort=version |
tail -n1)" ;;
*) runner="$(curl -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/bottlesdevs/wine/releases 2>&1 |
pcregrep -io "https://.*/download/.*/$1-.*\.tar(\.xz|\.gz)" |
sed -e '/cx/d' |
sort --sort=version |
tail -n1)" ;;
esac
echo "runner: $runner"
[ "$runner" ] || exit 1
# Fetch wine
wget -q --show-progress --progress=dot:mega "$runner"
# Extract wine
tar -xf ./*.tar.*
# Create appdir
mkdir -p AppDir
# Copy wine files to appdir
cp -r ./*-x86_64/* AppDir
# Remove tarball and extracted directory
rm -rf ./*-x86_64
# // cmd: !./% caffe
# vim: set expandtab fdm=marker ts=2 sw=2 tw=100 et :