diff --git a/.github/workflows/scripts-test.yml b/.github/workflows/scripts-test.yml index 2db7a1b..2dce64a 100644 --- a/.github/workflows/scripts-test.yml +++ b/.github/workflows/scripts-test.yml @@ -16,3 +16,19 @@ jobs: - uses: actions/checkout@v4 - name: Run install script run: ./scripts/install-qstract.sh + - run: qstract ./test/t3archive.tar + + test-install-script-2: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run install script + run: LIBC=musl ./scripts/install-qstract.sh + - run: qstract -z ./test/tarchive1.tar.gz + + test-install-script-3: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run install script + run: TARGET_STRING=aarch64-apple-darwin ./scripts/install-qstract.sh diff --git a/README.md b/README.md index 9379ad6..7499ce0 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ A very simple tar extraction program. ## Installation - +- You can download the latest prebuilt binaries of qstract [here](https://github.com/cargo-prebuilt/qstract/releases/latest). - - - - +- Cargo binstall: ```cargo binstall qstract --no-confirm``` +- Cargo quickinstall: ```cargo quickinstall qstract``` +- Homebrew: ```brew install crow-rest/harmless/qstract``` +- Install script (unix platforms): ```curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-prebuilt/qstract/main/scripts/install-qstract.sh | bash``` ## Args diff --git a/scripts/install-qstract.sh b/scripts/install-qstract.sh index 388e689..d79f18b 100755 --- a/scripts/install-qstract.sh +++ b/scripts/install-qstract.sh @@ -22,12 +22,13 @@ L_URL="https://github.com/cargo-prebuilt/qstract/releases/latest/download/" V_URL="https://github.com/cargo-prebuilt/qstract/releases/download/v" : ${VERSION:="latest"} +: ${INSTALL_PATH:="./"} : ${ARCH:="$(uname -m)"} : ${OS_TYPE:="$(uname -s)"} : ${LIBC:="gnu"} -if [ -z $TARGET_STRING ]; then +if [ -z ${TARGET_STRING+x} ]; then # Build target string TARGET_STRING="" @@ -105,4 +106,5 @@ fi # Download BIN_URL="$URL"'qstract-'"$TARGET_STRING" -curl --proto '=https' --tlsv1.2 -fsSL "$BIN_URL" -o $INSTALL_PATH/qstract +curl --proto '=https' --tlsv1.2 -fsSL "$BIN_URL" -o "$INSTALL_PATH"qstract +chmod +x "$INSTALL_PATH"qstract