-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget-dependencies.sh
More file actions
38 lines (29 loc) · 1.07 KB
/
Copy pathget-dependencies.sh
File metadata and controls
38 lines (29 loc) · 1.07 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
#!/bin/sh
set -eu
ARCH=$(uname -m)
echo "Installing package dependencies..."
echo "---------------------------------------------------------------"
# pacman -Syu --noconfirm PACKAGESHERE
echo "Installing debloated packages..."
echo "---------------------------------------------------------------"
get-debloated-pkgs --add-common --prefer-nano
# Comment this out if you need an AUR package
#make-aur-package PACKAGENAME
# If the application needs to be manually built that has to be done down here
echo "Getting binary..."
echo "---------------------------------------------------------------"
case "$ARCH" in
x86_64) farch=x64;;
aarch64) farch=arm64;;
esac
link=https://github.com/anomalyco/opencode/releases/latest/download/opencode-linux-$farch.tar.gz
if ! wget --retry-connrefused --tries=30 "$link" -O /tmp/temp.tar.gz 2>/tmp/download.log; then
cat /tmp/download.log
exit 1
fi
tar -xvf /tmp/temp.tar.gz
rm -f /tmp/temp.tar.gz
chmod +x ./opencode
mkdir -p ./AppDir/bin
cp -v ./opencode ./AppDir/bin
awk -F'/' '/Location:/{print $(NF-1); exit}' /tmp/download.log > ~/version