From 74fb660a18e2e15ca5641ae3d4090f98e283208a Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 11 Jun 2024 14:34:39 +0000 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68fc7a3..c4dc726 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Go Glitch is a command-line utility that reads log messages from a file or stdin To install the binary locally, you can use the provided installation script. Run the following command in your terminal: ```sh -curl -sSL https://git.nixc.us/Nixius/go-glitch/src/branch/master/install.sh | bash +curl -sSL https://git.nixc.us/Nixius/go-glitch/raw/branch/master/install.sh | bash ``` This will download and install the Go Glitch binary to your local machine. From 339ed5ddd3f08076bc14bb3ab69bbcfd3a6daf0f Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 11 Jun 2024 14:37:23 +0000 Subject: [PATCH 2/2] Optional Sudo --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 3f67e46..f4b7c46 100644 --- a/install.sh +++ b/install.sh @@ -31,7 +31,14 @@ fi BINARY_URL="${BASE_URL}/${binaries[$KEY]}" echo "Downloading and installing $BINARY_NAME from $BINARY_URL..." -sudo curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}" -sudo chmod +x "${INSTALL_DIR}/${BINARY_NAME}" +# Check if we have write permission to the install directory +if [ -w "${INSTALL_DIR}" ]; then + curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}" + chmod +x "${INSTALL_DIR}/${BINARY_NAME}" +else + sudo curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}" + sudo chmod +x "${INSTALL_DIR}/${BINARY_NAME}" +fi + echo "Installed $BINARY_NAME to $INSTALL_DIR"