Skip to content

Commit 449e5ac

Browse files
committed
fixing dots.sh script bugs
1 parent 8be8de6 commit 449e5ac

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/scripts/dots.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
set -eu
44

5+
if ! command -v wget 2>&1 >/dev/null; then
6+
echo 'Error: "wget" not found'
7+
exit 1
8+
fi
9+
if ! command -v python3 2>&1 >/dev/null; then
10+
echo 'Error: "python3" not found'
11+
exit 1
12+
fi
13+
514
machine="$(uname -m)"
615
case "$machine" in
716
x86_64)
@@ -22,7 +31,7 @@ case "$machine" in
2231
;;
2332
esac
2433

25-
release_blob="$(curl -s https://api.github.com/repos/harrybrwn/dots/releases/latest)"
34+
release_blob="$(wget -O- https://api.github.com/repos/harrybrwn/dots/releases/latest 2>/dev/null)"
2635
tag="$(
2736
printf "%s" "$release_blob" \
2837
| python3 -c 'import sys,json; print(json.loads(sys.stdin.read())["tag_name"],end="")'
@@ -35,8 +44,8 @@ TMP="$(mktemp -d)"
3544

3645
case "$ID" in
3746
arch|manjaro)
38-
wget -O "$TMP/dots.tar.zst" "${dl_url}/dots_${version}_linux_${arch}.tar.zst"
39-
pacman -U --noconfirm "$TMP/dots/tar.zst"
47+
wget -O "$TMP/dots.tar.zst" "${dl_url}/dots_${version}_linux_${arch}.pkg.tar.zst"
48+
pacman -U --noconfirm "$TMP/dots.tar.zst"
4049
;;
4150
debian|ubuntu|pop|linuxmint|raspbian)
4251
wget -O "$TMP/dots.deb" "${dl_url}/dots_${version}_linux_${arch}.deb"

0 commit comments

Comments
 (0)