Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ For Linux using custom installer:
curl -sSL https://bit.ly/install-xq | sudo bash
```

For Linux using custom installer, changing INSTALL_DIR, without sudo:
```
curl -sSL https://bit.ly/install-xq | INSTALL_DIR=$(pwd) bash
```

For Ubuntu 22.10 or higher via package manager:
```
apt-get install xq
Expand Down
10 changes: 5 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

URL_PREFIX="https://github.com/sibprogrammer/xq"
INSTALL_DIR=/usr/local/bin/
INSTALL_DIR=${INSTALL_DIR:-/usr/local/bin}
BINARY=xq
LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' $URL_PREFIX/releases/latest | sed -e 's/.*"tag_name":"v\([^"]*\)".*/\1/')
PLATFORM=$(uname -s | tr A-Z a-z)
Expand All @@ -28,7 +28,7 @@ ARCHIVE="${BINARY}_${LATEST_VERSION}_${PLATFORM}_${ARCH}.tar.gz"
URL="$URL_PREFIX/releases/download/v${LATEST_VERSION}/$ARCHIVE"

echo "Installation of $BINARY"
rm -f $INSTALL_DIR$BINARY
curl -sSL "$URL" | tar xz -C $INSTALL_DIR $BINARY
chmod +x $INSTALL_DIR$BINARY
echo "Successfully installed at $INSTALL_DIR$BINARY"
rm -f $INSTALL_DIR/$BINARY
curl -sSL "$URL" | tar xz -C $INSTALL_DIR/ $BINARY
chmod +x $INSTALL_DIR/$BINARY
echo "Successfully installed at $INSTALL_DIR/$BINARY"