From 24b24c089c674e1b8f8b831589035395a60341cb Mon Sep 17 00:00:00 2001
From: x <okp57855@psoxs.com>
Date: Wed, 19 Sep 2018 12:23:51 +1200
Subject: [PATCH] Final Prdouction code - AutoGitVersionUploadBackground.sh

---
 devTools/AutoGitVersionUploadBackground.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/devTools/AutoGitVersionUploadBackground.sh b/devTools/AutoGitVersionUploadBackground.sh
index daab2796e9c..cfb17ea2a37 100755
--- a/devTools/AutoGitVersionUploadBackground.sh
+++ b/devTools/AutoGitVersionUploadBackground.sh
@@ -1,12 +1,12 @@
-#!/bin/sh Additional packages required: meg	MEGAcmd and git
-RD=/Root/FC LD=/tmp/FC U=anon@anon.anon P=13245 Branch=git@ssh.gitgud.io:pregmodfan/fc-pregmod.git ; echo "Fresh clone?" && read VN && clear && mega-login $U $P > /dev/null
+#!/bin/sh Additional packages required: megatools,	MEGAcmd and git
+V=-1 RD=FC/ LD=/tmp/FC U=anon@anon.anon P=13245 Branch=git@ssh.gitgud.io:pregmodfan/fc-pregmod.git ; echo "Fresh clone?" && read VN && clear && mega-login $U $P > /dev/null
 while true; do
-	if [[ $VN == y||$VN == yes ]]; then V=2 && mkdir $LD ; git clone -q $Branch $LD && cd $LD/
-	elif [[ ($VN == n||$VN == no) || $V = 0 ]]; then cd $LD/ && git fetch -q
+	if [[ $VN == y||$VN == yes ]]; then V=2 && mkdir $LD ; git clone -q $Branch $LD
+	elif [[ $VN == n||$VN == no||$V = 0 ]]; then cd $LD/ && git fetch -q
 		if  [ `git rev-list HEAD...origin/pregmod-master --count` != 0 ]; then git pull -q && V=1
 		fi #Check is a slight tweak of https://stackoverflow.com/a/17192101
 	fi
-	if [[ ($V = 2||$V = 1) || $VN == na ]]; then rm bin/*.html ; ./compile > /dev/null && minify -o bin/FC_pregmod.html bin/FC_pregmod.html && mv bin/FC_pregmod.html "bin/FC-pregmod-$(git log -1 --format='%cd' --date='format:%d-%m-%Y-%H-%M')-$(git log -n1 --abbrev-commit|grep -m1 commit|sed 's/commit //')".html && mega-put bin/*.html FC/ && megals -u $U -p $P /Root/FC|sed -n '1!p'|sort -r|tail -n +11|paste -sd " " -|xargs megarm -u $U -p $P > /dev/null && V=0
+	if [[ $VN == na||$V == 2||$V == 1 ]]; then V=0 && cd $LD/ && rm bin/*.html ; ./compile > /dev/null && minify -o bin/FC_pregmod.html bin/FC_pregmod.html && mv bin/FC_pregmod.html "bin/FC-pregmod-$(git log -1 --format='%cd' --date='format:%d-%m-%Y-%H-%M')-$(git log -n1 --abbrev-commit|grep -m1 commit|sed 's/commit //')".html && mega-put bin/*.html FC/ && megals -u $U -p $P /Root/FC|sed -n '1!p'|sort -r|tail -n +11|paste -sd " " -|xargs megarm -u $U -p $P > /dev/null
 	fi
 	clear && sleep 15m
 done 
\ No newline at end of file
-- 
GitLab