From 50d3c0d834533db371afd6fc12cad2ade661252d Mon Sep 17 00:00:00 2001 From: Aloxion Date: Sun, 2 Jun 2024 17:55:08 +0200 Subject: [PATCH] better practice --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++- chewed-gum => main.sh | 0 2 files changed, 44 insertions(+), 1 deletion(-) rename chewed-gum => main.sh (100%) diff --git a/README.md b/README.md index ff27a1f..b2abfaf 100644 --- a/README.md +++ b/README.md @@ -1 +1,44 @@ -# chewed-gum \ No newline at end of file +# chewed-gum + +# Install Using CURL + +To use this tool, you need two things. + +* A path, where it is going to be exported to. +* Gum | Charmbracelet + + +## Gum + +## Tool - Chewed gum + +First make you sure you have a directory, you can extract the tar file to. + +e.g: + +```bash +mkdir $HOME/chewed-gum +``` + +This will create a directory chewed-gum from your home directory. + + +To download the release, you can use this command: +If you want to declare a specific path, you can adjust the "$HOME/chewed-gum" +### Download latest tag +```sh +LATEST_TAG=$(curl -s https://api.github.com/repos/Aloxion/chewed-gum/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && mkdir -p $HOME/chewed-gum-$LATEST_TAG && curl -sL "https://github.com/Aloxion/chewed-gum/archive/refs/tags/${LATEST_TAG}.tar.gz" | tar -xzf - --strip-components=1 -C $HOME/chewed-gum-$LATEST_TAG && chmod +x $HOME/chewed-gum-$LATEST_TAG/chewed-gum && (grep -q 'export PATH=$HOME/chewed-gum-$LATEST_TAG:$PATH' ~/.zshrc || echo 'export PATH=$HOME/chewed-gum-$LATEST_TAG:$PATH' >> ~/.zshrc) && source ~/.zshrc +``` + +### Downloade specifc tag +Remember, to replace \, with the actual version you want to use. +```sh +curl -sL "https://github.com/Aloxion/chewed-gum/archive/refs/tags/.tar.gz" | tar -xzf - --strip-components=1 -C $HOME/chewed-gum- +``` + +### Permissions +If any issues occur with permission, remember to allow the chewed-gum file to be ran like so: + +```sh +chmod +x $HOME/chewed-gum/chewed-gum +``` \ No newline at end of file diff --git a/chewed-gum b/main.sh similarity index 100% rename from chewed-gum rename to main.sh