Skip to content

Commit 7bf224c

Browse files
authored
update install script (#24)
* update install script * don't use set
1 parent 46bc8eb commit 7bf224c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

install.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
#!/bin/sh -e
1+
#!/bin/sh -eu
22

33
################################################################################
44
# Description: install the latest version of pixel-backup to the local directory
55
# Author: Vivek Revankar <vivek@master-hax.com>
66
# Usage: sh -c "$(curl -fSs https://raw.githubusercontent.com/master-hax/pixel-backup-gang/master/install.sh)"
77
################################################################################
88

9-
pbg_tarball_url="https://github.com/master-hax/pixel-backup-gang/releases/download/0.0.2/pixel-backup-gang-0.0.2.tar.gz"
10-
pbg_tarball_filename="pixel-backup-gang-latest.tar.gz"
11-
echo "install.sh: downloading the latest release"
12-
curl -fL $pbg_tarball_url --output $pbg_tarball_filename
13-
echo "install.sh: unpacking the release archive (requires root)"
14-
/sbin/su --command "tar -xvf $pbg_tarball_filename"
15-
echo "install.sh: make the release executable (requires root)"
16-
/sbin/su --command "chmod +x ./pixel-backup-gang/*.sh"
9+
pbg_tarball_version="0.0.2"
10+
pbg_tarball_filename="pixel-backup-gang-$pbg_tarball_version.tar.gz"
11+
pbg_tarball_url="https://github.com/master-hax/pixel-backup-gang/releases/download/$pbg_tarball_version/$pbg_tarball_filename"
12+
echo "install.sh: downloading version $pbg_tarball_version from github"
13+
curl -fL $pbg_tarball_url --output $pbg_tarball_filename || { echo 'failed to download release archive' ; exit 1; }
14+
echo "install.sh: unpacking the release archive (requires root)" || { echo 'failed to unpack release archive' ; exit 1; }
15+
su --command "tar -xvf $pbg_tarball_filename" || { echo 'failed to inflate release archive' ; exit 1; }
16+
echo "install.sh: making the release executable (requires root)"
17+
su --command "chmod +x ./pixel-backup-gang/*.sh" || { echo 'failed to make scripts executable' ; exit 1; }
1718
echo "install.sh: pixel backup gang successfully installed to $(realpath ./pixel-backup-gang)"

0 commit comments

Comments
 (0)