Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: write simple installation script #2

Merged
merged 2 commits into from
Aug 30, 2024
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ Zig references I used:

# Installation

I promise that I will write an installation tutorial... maybe (feel free to help with that with a PR).
For now, you can install from our pre-built binary (Linux only):

```sh
curl -sSL https://raw.githubusercontent.com/brasilisclub/zignr/install-script/install.sh | bash -
```

> To make `zignr` available globally you should have `~/.local/bin` on you `PATH`

# Usage

Expand Down
30 changes: 30 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

binary_url="https://github.com/ivansantiagojr/zignr/releases/download/v0.1.1/binary-0.1.1-x86_64-linux"
binary_name="zignr"

echo "Downloading zignr..."
wget -q "$binary_url" -O "$binary_name"

if [ $? -ne 0 ]; then
echo "Failed to download zignr."
exit 1
fi

echo "Making zignr executable..."
chmod +x "$binary_name"

echo "Moving zignr to ~/.local/bin..."
mv "$binary_name" "$HOME/.local/bin/$binary_name"

# Verify installation
if [ $? -eq 0 ]; then
echo "zignr installed successfully!"
else
echo "Failed to move zignr to ~/.local/bin. You might need sudo privileges."
exit 1
fi

echo
echo "add ~/.local/bin to you PATH so you can run zignr from anywhere"
echo "then use run zignr"
Loading