mirror of
https://github.com/ION606/VCS.git
synced 2026-05-14 22:16:55 +00:00
added colors
This commit is contained in:
@@ -3,7 +3,7 @@ A future version control system and file sharing system built over rsync and ins
|
|||||||
|
|
||||||
## Running
|
## Running
|
||||||
## Option 1: The Script
|
## Option 1: The Script
|
||||||
just use `curl -fsSL -o ivcs.sh https://github.com/ION606/VCS/raw/main/init.sh && chmod +x ivcs.sh && sudo ./ivcs.sh`
|
just use `curl -fsSL -o ivcs.sh https://github.com/ION606/VCS/raw/main/init.sh && chmod +x ivcs.sh && ./ivcs.sh`
|
||||||
|
|
||||||
|
|
||||||
## Option 2: Maually
|
## Option 2: Maually
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ mkdir -p .ionvcs
|
|||||||
|
|
||||||
# Check if a path is provided as an argument
|
# Check if a path is provided as an argument
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "please provide a path to clone (like ~/Desktop/code_here)"
|
echo -e "\e[31mERROR!\e[0m please provide a path to clone (like \e[34m~/Desktop/code_here\e[0m)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -20,11 +20,12 @@ fi
|
|||||||
# Create the destination folder if it doesn't exist
|
# Create the destination folder if it doesn't exist
|
||||||
mkdir -p "$DEST_FOLDER"
|
mkdir -p "$DEST_FOLDER"
|
||||||
|
|
||||||
|
|
||||||
# Source the credentials file if it exists
|
# Source the credentials file if it exists
|
||||||
if [ -f "$HOME/ionsrc/creds.txt" ]; then
|
if [ -f "$HOME/ionsrc/creds.txt" ]; then
|
||||||
source "$HOME/ionsrc/creds.txt"
|
source "$HOME/ionsrc/creds.txt"
|
||||||
else
|
else
|
||||||
echo "credentials file not found! (please use the login command)"
|
echo -e "\e[31mcredentials file not found!\e[0m (please use the \e[0;32mlogin\e[0m command)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
if [ -f "$HOME/ionsrc/creds.txt" ]; then
|
if [ -f "$HOME/ionsrc/creds.txt" ]; then
|
||||||
source "$HOME/ionsrc/creds.txt"
|
source "$HOME/ionsrc/creds.txt"
|
||||||
echo "logged in as $username!"
|
echo "logged in as \033[0;31m$username\e[0m!"
|
||||||
else
|
else
|
||||||
echo "no user found!"
|
echo "no user found!"
|
||||||
fi
|
fi
|
||||||
@@ -7,7 +7,7 @@ if ! command -v sshpass &> /dev/null || ! command -v pv &> /dev/null || ! comman
|
|||||||
elif command -v apt-get &> /dev/null; then
|
elif command -v apt-get &> /dev/null; then
|
||||||
sudo apt-get -y install sshpass pv git
|
sudo apt-get -y install sshpass pv git
|
||||||
else
|
else
|
||||||
echo "Package manager not found. Please install sshpass, pv, and git manually"
|
echo -e "\e[31mPackage manager not found. Please install sshpass, pv, and git manually\e[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -16,9 +16,10 @@ fi
|
|||||||
git clone https://github.com/ION606/VCS.git .ionvcs
|
git clone https://github.com/ION606/VCS.git .ionvcs
|
||||||
|
|
||||||
# Move files
|
# Move files
|
||||||
sudo mv .ionvcs/ionsrc.desktop /usr/share/applications/ionsrc.desktop || echo "FAILED TO MOVE DESKTOP FILE"
|
sudo mv .ionvcs/ionsrc.desktop /usr/share/applications/ionsrc.desktop || echo -e "\e[31mFAILED TO MOVE DESKTOP FILE\e[0m"
|
||||||
mkdir -p ~/ionsrc
|
mkdir -p ~/ionsrc
|
||||||
mv .ionvcs/* ~/ionsrc/
|
mv .ionvcs/* ~/ionsrc/
|
||||||
|
echo "alias ionvcs='bash ~/ionsrc/run.sh'" >> ~/.bashrc
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -rf .ionvcs
|
rm -rf .ionvcs
|
||||||
|
|||||||
@@ -15,5 +15,5 @@ echo "password=$password" >> "$CREDSFILE";
|
|||||||
# Secure the file
|
# Secure the file
|
||||||
chmod 600 "$CREDSFILE";
|
chmod 600 "$CREDSFILE";
|
||||||
|
|
||||||
echo "Logged in!";
|
echo "Logged in as \033[0;31m$username\e[0m!";
|
||||||
exit;
|
exit;
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
cd "$PWD"
|
cd "$PWD"
|
||||||
|
|
||||||
if [ ! -f "$HOME/ionsrc/creds.txt" ]; then
|
if [ ! -f "$HOME/ionsrc/creds.txt" ]; then
|
||||||
echo "credentials file not found!"
|
echo -e "\e[31mcredentials file not found!\e[0m"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ ! -f "$PWD/.ionvcs/src.config"]; then
|
elif [ ! -f "$PWD/.ionvcs/src.config"]; then
|
||||||
echo "config file not found!"
|
echo -e "\e[31mconfig file not found!\e[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ DIFF_OUTPUT=$(/usr/bin/sshpass -p "$password" rsync -avcn --delete -e ssh "$REMO
|
|||||||
|
|
||||||
# Check if there are differences
|
# Check if there are differences
|
||||||
if [ ! -z "$DIFF_OUTPUT" && ! $force_flag ]; then
|
if [ ! -z "$DIFF_OUTPUT" && ! $force_flag ]; then
|
||||||
echo "conflicts found between the local and remote directories (make sure they're correct and re-run using the -f flag):"
|
echo -e "\e[31mERROR\e[0m conflicts found between the local and remote directories (make sure they're correct and re-run using the \e[31m-f\e[0m flag):"
|
||||||
echo "$DIFF_OUTPUT"
|
echo "$DIFF_OUTPUT"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,30 +5,33 @@ shift;
|
|||||||
|
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
"clone")
|
"clone")
|
||||||
bash clone.sh "$@"
|
bash $HOME/ionsrc/clone.sh "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"push")
|
"push")
|
||||||
bash push.sh "$@"
|
bash $HOME/ionsrc/push.sh "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"login")
|
"login")
|
||||||
bash login.sh "$@"
|
bash $HOME/ionsrc/login.sh "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"user")
|
"user")
|
||||||
bash getuser.sh
|
bash $HOME/ionsrc/getuser.sh
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"status")
|
"status")
|
||||||
bash status.sh
|
bash $HOME/ionsrc/status.sh
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"help")
|
"help")
|
||||||
bash help.sh
|
bash $HOME/ionsrc/help.sh
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "UNKNOWN COMMAND \"$@\""
|
echo "UNKNOWN COMMAND \"$COMMAND\""
|
||||||
|
GREEN='\033[0;31m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
echo -e "use ${GREEN}\`ionvcs help\`${NC} for help"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
cd "$PWD"
|
cd "$PWD"
|
||||||
|
|
||||||
if [ ! -f "$HOME/ionsrc/creds.txt" ]; then
|
if [ ! -f "$HOME/ionsrc/creds.txt" ]; then
|
||||||
echo "credentials file not found!"
|
echo -e "\e[31mcredentials file not found!\e[0m"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ ! -f "$PWD/.ionvcs/src.config"]; then
|
elif [ ! -f "$PWD/.ionvcs/src.config"]; then
|
||||||
echo "config file not found!"
|
echo -e "\e[31mconfig file not found!\e[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user