From 992be20c108b0f68dad1aa2fdc56e998e28e51ea Mon Sep 17 00:00:00 2001 From: Josh Ashton Date: Mon, 12 Feb 2024 20:32:03 -0700 Subject: [PATCH] added readme and finished install script --- README.md | 13 +++++++++++++ dependencies.txt | 0 install | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 README.md delete mode 100644 dependencies.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..6547158 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Utility scripts for Linux and MacOS. + +# Installation: +`git clone https://github.com/quaxlyqueen/scripts`
+`cd scripts`
+`sudo ./install`
+ +# Features: +- Shortened Git commands with help information; +- Bookmarking directories in the terminal; +- Automated-installation scripts for Linux and MacOS projects; +- Project creation and universal code execution; +- Misc. i3-wm related theming and brightness/volume control diff --git a/dependencies.txt b/dependencies.txt deleted file mode 100644 index e69de29..0000000 diff --git a/install b/install index dfd66cd..bf26d6c 100755 --- a/install +++ b/install @@ -13,4 +13,48 @@ echo "export PATH=$PATH:/usr/local/bin" >> ~/.zshrc # Install the dependencies echo "Installing dependencies..." + # Install github-cli +if ! command -v "gh" &> /dev/null +then + echo "gh not found. Installing gh..." + COMMAND="gh" + PACKAGE="github-cli" + + if [[ "$OSTYPE" == "darwin"* ]]; then + + DISTRO=$(cat /etc/os-release | grep -oP '(?<=^ID=).+' | tr -d '"') + + if [[ $DISTRO == "arch" ]]; then + yes | sudo pacman -S $PACKAGE + elif [[ $DISTRO == "archarm" ]]; then + yes | sudo pacman -S $PACKAGE + elif [[ $DISTRO == "ubuntu" ]]; then + yes | sudo apt-get install $PACKAGE + elif [[ $DISTRO == "fedora" ]]; then + yes | sudo dnf install $PACKAGE + elif [[ $DISTRO == "centos" ]]; then + yes | sudo yum install $PACKAGE + elif [[ $DISTRO == "debian" ]]; then + yes | sudo apt install $PACKAGE + else + echo "Unsupported distro. Please install $COMMAND from $PACKAGE manually." + fi + + elif [[ "$OSTYPE" == "darwin"* ]]; then + echo "gh not found. Installing gh..." + + if command -v "brew" &> /dev/null + then + yes | brew install $COMMAND + + elif command -v "port" &> /dev/null + then + yes | sudo port install $COMMAND + + else + echo "Homebrew or MacPorts not found. Please install one of them before running this script." + exit 1 + fi + fi +fi