From d0b9f4bfcf4fbbc26eafba310945a414691a52bb Mon Sep 17 00:00:00 2001 From: mutto233 <39921339+mutto233@users.noreply.github.com> Date: Mon, 9 Jul 2018 10:58:35 -0400 Subject: [PATCH] Installer update The installer has been made a bit more user friendly. - To install, simply PLACE the installer in the folder you would like to use. You can make it yourself with mkdir, then drop it in there. first_run is still a valid variable, and will make some "pseudo-channel_#" files for you to start - Input is now accepted as either "develop" or "master" to choose the branch you would like to download from "master" will download the master branch and install/update "develop" will download the develop branch and install/update. --- main-dir/update-channels-from-git.sh | 30 +++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/main-dir/update-channels-from-git.sh b/main-dir/update-channels-from-git.sh index f91f8f3..ab66e1c 100644 --- a/main-dir/update-channels-from-git.sh +++ b/main-dir/update-channels-from-git.sh @@ -4,6 +4,8 @@ #---- # Simple script to update every channel with updates from the github repo. # BACKUP EACH XML/DB IN EACH CHANNEL. +# Code will take in one argument: To take from the master or development branch +# For ALL installs, simply place this file in the location you would like your channels to be installed/updated #---- #---- @@ -14,14 +16,22 @@ #----BEGIN EDITABLE VARS---- -SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/mutto233/pseudo-channel . --branch master' +if [ $# -gt 1 ]; then + echo "ERROR: Please only supply one argument" + exit 9999 +elif [ "$1" == "develop" ]; then + echo "Downloading the develop branch" + SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/mutto233/pseudo-channel . --branch develop' + +else + echo "Downloading the master branch" + SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/mutto233/pseudo-channel . --branch master' +fi OUTPUT_PREV_CHANNEL_PATH=. CHANNEL_DIR_INCREMENT_SYMBOL="_" -INSTALL_FOLDER="channels" - FIRST_INSTALL=false #----END EDITABLE VARS------- @@ -44,8 +54,6 @@ FIRST_INSTALL=false # If this is our first install, we will now make all necessary directories to prepare for install if [ "$FIRST_INSTALL" == "true" ]; then - mkdir $INSTALL_FOLDER - cd $INSTALL_FOLDER for (( num=1; num<=5; num++ )) do @@ -54,15 +62,6 @@ if [ "$FIRST_INSTALL" == "true" ]; then fi -# Sanity check, are we in the install folder? This is just to make sure we don't run into errors. -if [ ! -d "../$INSTALL_FOLDER" ]; then - echo "ERROR: NOT IN '$INSTALL_FOLDER' FOLDER, PLEASE MAKE SURE WE ARE IN HERE!" - echo "Did you mean to set FIRST_RUN=true?" - exit 9999 -fi - - - #### Next, let's download the latest master version of information from GitHub and store it in a temporary folder mkdir github_download cd github_download @@ -157,7 +156,6 @@ rm -rf ./.pseudo-temp rm -rf ./github_download #### Change permissions to 777 for all files, so that things will run -cd .. -sudo chmod -R 777 "./$INSTALL_FOLDER" +sudo chmod -R 777 . echo "Update Complete"