implement cli tools for ease of use

This commit is contained in:
daveberrys committed 2026-07-20 20:47:32 +08:00
1 parent 2e91a67c8f
commit 4207db52ba
6 files changed
+208 -5

No files matched your search

+4 -5
View File
@@ -1,16 +1,15 @@
#!/bin/bash
echo "This will install the compiled local 'guh' binary to '~/.local/bin' directory."
echo "Installing..."
echo "This script will install the 'guh' binary in the '~/.local/bin' directory."
echo
go mod tidy && echo "Tidied go.mod and go.sum files."
go get ./ && echo "Installed all packages." || echo "Failed to install all packages."
go build && echo "Built 'guh' binary." || echo "Failed to build 'guh' binary."
go build -ldflags "-X 'github.com/daveberrys/guh/src/cmd/cli.Version=$(git rev-parse --short HEAD)'" -o guh . && echo "Built 'guh' binary." || echo "Failed to build 'guh' binary."
echo
cp guh ~/.local/bin/guh && echo "Successfully placed 'guh' in '~/.local/bin' directory." || echo "Failed to place 'guh' in '~/.local/bin' directory."
chmod +x ~/.local/bin/guh && echo "Successfully made 'guh' executable." || echo "Failed to make 'guh' executable."
cp guh /home/$USER/.local/bin/guh && echo "Successfully placed 'guh' in '~/.local/bin' directory." || echo "Failed to place 'guh' in '~/.local/bin' directory."
chmod +x /home/$USER/.local/bin/guh && echo "Successfully made 'guh' executable." || echo "Failed to make 'guh' executable."
guh >> /dev/null && echo "Successfully installed 'guh' binary." || echo "Failed to install 'guh' binary."
echo "Installation complete."