From 2e5b8a74483c2f8ec31e362f9eef1ce55a785293 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Mon, 5 Apr 2021 17:43:48 +0800 Subject: [PATCH] bin: Renamed install-toolkit into toolkit-mgr Signed-off-by: Andrei Jiroh Eugenio Halili --- bin/install-toolkit | 23 ----------------------- bin/toolkit-mgr | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 23 deletions(-) delete mode 100755 bin/install-toolkit create mode 100755 bin/toolkit-mgr diff --git a/bin/install-toolkit b/bin/install-toolkit deleted file mode 100755 index 27e3258..0000000 --- a/bin/install-toolkit +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -if echo "$OSTYPE" | grep -qE '^linux-gnu.*' && [ -f '/etc/debian_version' ]; then - PKGMGR="sudo apt-get" -else - PKGMGR="pkg" -fi - -## Install Python, Wget and cURL -if echo "$OSTYPE" | grep -qE '^linux-android.*'; then - $PKGMGR install python nodejs-lts nano wget git -y -else - $PKGMGR install python3 python3-dev python3-pip nano curl wget -y -fi - -## Then, install Node.js using nvm - -NODEJS_INSTALL_PATH=$(command -v node) -if [[ $NODEJS_INSTALL_PATH == "" ]]; then - true -else - echo "info: Node.js is installed, skipping..." -fi diff --git a/bin/toolkit-mgr b/bin/toolkit-mgr new file mode 100755 index 0000000..f7f70de --- /dev/null +++ b/bin/toolkit-mgr @@ -0,0 +1,24 @@ +#!/bin/bash + +help() { + echo "Toolkit Manager - Manage toolkit scripts - v0.1.0" + echo + echo "Usage: $0 COMMAND ARGS" + echo "Available commands:" + echo "add [URL|MODULENAME] Install new script from the Internet" + echo " and add to PATH." + echo "run [TOOLKIT] [ARGS] Run the script without using PATH" + echo "list List installed scripts" + echo "uninstall [TOOLKIT] Remove from your local ~/.toolkits/bin" +} + +commandNotYetImplemented() { + echo "error: Unknown command. Try 'toolkit-mgr help' to learn more." + exit +} + +if [[ $@ == "" || $@ == "help" ]]; then + help +else + commandNotYetImplemented +fi