Skip to content

Commit

Permalink
Improve install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
emilevr committed Nov 4, 2023
1 parent 3a5472c commit 0fdcd79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ jobs:
}
}
publish-scoop-manifest:
if: ${{ github.ref == 'refs/heads/main' }}
publish-pages:
if: github.ref == 'refs/heads/main'
needs: build-and-test
runs-on: ubuntu-latest

Expand Down
10 changes: 6 additions & 4 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ case "${UNAME_OUTPUT}" in
esac

ARCHIVE_FILE_URL=https://github.com/emilevr/space/releases/latest/download/$ARCHIVE_FILENAME
ARCHIVE_FILE_PATH=~/$ARCHIVE_FILENAME
BINARY_FILE_PATH=~/space
ARCHIVE_DIR=$HOME
ARCHIVE_FILE_PATH=$ARCHIVE_DIR/$ARCHIVE_FILENAME
BINARY_FILE_PATH=$ARCHIVE_DIR/space
INSTALL_DIR=/usr/local/bin
INSTALL_FILE_PATH=$INSTALL_DIR/space

echo "Downloading the latest binary from $ARCHIVE_FILE_URL ..."
curl -L -o $ARCHIVE_FILE_PATH $ARCHIVE_FILE_URL

echo "Extacting downloaded file $ARCHIVE_FILE_PATH"
tar -xzvf $ARCHIVE_FILE_PATH
tar -xzvf $ARCHIVE_FILE_PATH -C $ARCHIVE_DIR/

echo "Making the binary executable"
chmod +x $BINARY_FILE_PATH

echo "Moving $BINARY_FILE_PATH to $INSTALL_DIR"
sudo mv $BINARY_FILE_PATH "${INSTALL_DIR}/space"
sudo mv $BINARY_FILE_PATH $INSTALL_FILE_PATH

echo "Cleaning up..."
rm -f $ARCHIVE_FILE_PATH
Expand Down

0 comments on commit 0fdcd79

Please sign in to comment.