Skip to content

Commit

Permalink
README and install script
Browse files Browse the repository at this point in the history
  • Loading branch information
harmless-tech committed Feb 25, 2024
1 parent 088e1b7 commit 2f57185
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/scripts-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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). -->
- You can download the latest prebuilt binaries of qstract [here](https://github.com/cargo-prebuilt/qstract/releases/latest).
<!-- - Cargo install: ```cargo install qstract``` -->
<!-- - Cargo prebuilt: ```cargo prebuilt qstract``` -->
<!-- - 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``` -->
- 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```
<!-- - For github actions you can use [cargo-prebuilt/cargo-prebuilt-action](https://github.com/cargo-prebuilt/cargo-prebuilt-action) -->

## Args
Expand Down
6 changes: 4 additions & 2 deletions scripts/install-qstract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""

Expand Down Expand Up @@ -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

0 comments on commit 2f57185

Please sign in to comment.