blob: 02e7473537df14551ffca353abbc0915af6ace7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# Manual Install
This document contains methods on how to install `gfold` "manually" (i.e. without a package manager or registry).
## Download and Install a Binary on macOS and Linux
Executing the commands in this section requires the following:
- macOS or Linux (GNU, not MUSL) system
- `x86_64 / amd64` architecture
- `bash` shell (or compatible)
- `jq`, `wget` and `curl` installed and in `PATH`
First, let's ensure we have our prerequisite binaries installed.
```bash
for BINARY in "jq" "wget" "curl"; do
if ! [ "$(command -v ${BINARY})" ]; then
echo "\"$BINARY\" must be installed and in PATH"
return
fi
done
```
Now, let's determine which binary we need to choose based on our platform.
```bash
INSTALL_OS=""
if [ "$(uname -s)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then
INSTALL_OS="linux-gnu"
elif [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "x86_64" ]; then
INSTALL_OS="darwin"
else
echo "must execute on Linux or Darwin x86_64 (x86_64 / amd64) host"
return
fi
```
We need to determine to latest tag to build our release URL.
```bash
LATEST=$(curl -s https://api.github.com/repos/nickgerace/gfold/releases/latest | jq -r ".tag_name")
```
With the latest tag and platform determined, we can finally download and install `gfold` to `/usr/local/bin/`.
```bash
# Remove gfold if it is already in /tmp.
if [ -f /tmp/gfold ]; then
rm /tmp/gfold
fi
# Perform the download.
wget -O /tmp/gfold https://github.com/nickgerace/gfold/releases/download/$LATEST/gfold-$INSTALL_OS-amd64
# Set executable permissions.
chmod +x /tmp/gfold
# Remove gfold if it is already in /usr/local/bin/.
if [ -f /usr/local/bin/gfold ]; then
rm /usr/local/bin/gfold
fi
# Move gfold into /usr/local/bin/.
mv /tmp/gfold /usr/local/bin/gfold
```
### Uninstalling and Cleaning Up
If you would like to uninstall `gfold` and remove potential artifacts from the method above, execute the following:
```bash
# Remove potential installed and/or downloaded artifacts.
rm /tmp/gfold
rm /usr/local/bin/gfold
# (Optional) remove the configuration file.
rm $HOME/.config/gfold.toml
```
## Build From Source Locally with Cargo
If you want to install from source locally, and not from [crates.io](https://crates.io/crates/gfold), you can clone the repository and build `gfold`.
This should work on all major platforms.
```shell
git clone https://github.com/nickgerace/gfold.git
cargo install --path gfold
```
|