more polishing for release
This commit is contained in:
parent
3ec54ba492
commit
252001a05d
10 changed files with 47 additions and 10 deletions
|
@ -96,3 +96,7 @@ inex_rm(){
|
||||||
sed -i "${rmlines}" "${sapphrc_config}/backups/${profile_name}/${inex}"
|
sed -i "${rmlines}" "${sapphrc_config}/backups/${profile_name}/${inex}"
|
||||||
echo "Removed ${#choices[@]} paths from ${profile_name} ${inex} list"
|
echo "Removed ${#choices[@]} paths from ${profile_name} ${inex} list"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validate_backupdir(){
|
||||||
|
[ -d "$HOME/.config/sapphrc/backups/.git" ] || echo "git repo not initialized! Something's gone wrong" && exit 1
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,14 @@ restore() {
|
||||||
sapphrc_restore $@
|
sapphrc_restore $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updown() {
|
||||||
|
sapphrc_updown $@
|
||||||
|
}
|
||||||
|
|
||||||
|
push() {
|
||||||
|
sapphrc_push $@
|
||||||
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Sapphic Package Manager v${VERSION}"
|
echo "Sapphic Package Manager v${VERSION}"
|
||||||
cat ./usr/share/doc/sapphrc/sapphrc
|
cat ./usr/share/doc/sapphrc/sapphrc
|
||||||
|
@ -29,7 +37,7 @@ usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
setup|profile|backup|restore )
|
setup|profile|backup|restore|updown|push )
|
||||||
shift 1;;&
|
shift 1;;&
|
||||||
setup )
|
setup )
|
||||||
setup $@;;
|
setup $@;;
|
||||||
|
@ -39,6 +47,10 @@ case $COMMAND in
|
||||||
backup $@;;
|
backup $@;;
|
||||||
restore )
|
restore )
|
||||||
restore $@;;
|
restore $@;;
|
||||||
|
updown )
|
||||||
|
updown $@;;
|
||||||
|
push )
|
||||||
|
push $@;;
|
||||||
*|usage )
|
*|usage )
|
||||||
usage;;
|
usage;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
sapphrc_config="$HOME/.config/sapphrc"
|
sapphrc_config="$HOME/.config/sapphrc"
|
||||||
|
|
||||||
cat "${sapphrc_config}/active_profiles" | while read profile_name
|
cat "${sapphrc_config}/active_profiles" | while read profile_name
|
||||||
|
|
|
@ -4,6 +4,7 @@ COMMAND=$1
|
||||||
|
|
||||||
source ./lib/sapphrc/sapphrc-functions
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
source ./lib/sapphrc/sapphrc-font
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
inex="exclude"
|
inex="exclude"
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ COMMAND=$1
|
||||||
|
|
||||||
source ./lib/sapphrc/sapphrc-functions
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
source ./lib/sapphrc/sapphrc-font
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
inex="include"
|
inex="include"
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
source ./lib/sapphrc/sapphrc-functions
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
source ./lib/sapphrc/sapphrc-font
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
COMMAND="${1}"
|
COMMAND="${1}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
cd "$HOME/.config/sapphrc/backups"
|
cd "$HOME/.config/sapphrc/backups"
|
||||||
git add .;
|
git add .;
|
||||||
git add -u;
|
git add -u;
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
cd "$HOME/.config/sapphrc/backups"
|
cd "$HOME/.config/sapphrc/backups"
|
||||||
git pull --no-edit
|
git pull --no-edit
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
sapphrc_config="$HOME/.config/sapphrc"
|
sapphrc_config="$HOME/.config/sapphrc"
|
||||||
if [ -f "${aspphic_config}/.init_complete"];then
|
if [ -f "${aspphic_config}/.init_complete" ];then
|
||||||
echo "already setup"
|
echo "already setup"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -11,7 +10,7 @@ mkdir -p "${sapphrc_config}"
|
||||||
mkdir -p "${HOME}/.sapphrc"
|
mkdir -p "${HOME}/.sapphrc"
|
||||||
|
|
||||||
while true;do
|
while true;do
|
||||||
read -p "use an existing git repo? (y/n)" gitrepo_exists
|
read -p "pull from an existing backup repo? (y/n) " gitrepo_exists
|
||||||
case $gitrepo_exists in
|
case $gitrepo_exists in
|
||||||
[Yy] )
|
[Yy] )
|
||||||
read -p "Enter YOUR git repo url: " git_url
|
read -p "Enter YOUR git repo url: " git_url
|
||||||
|
@ -36,7 +35,8 @@ while true;do
|
||||||
mkdir -p "${sapphrc_config}/backups"
|
mkdir -p "${sapphrc_config}/backups"
|
||||||
cd "${sapphrc_config}/backups"
|
cd "${sapphrc_config}/backups"
|
||||||
git init
|
git init
|
||||||
git add "${sapphrc_config}/backups/."
|
touch ./active_profiles
|
||||||
|
git add .
|
||||||
git commit -m "first commit"
|
git commit -m "first commit"
|
||||||
git branch -M main
|
git branch -M main
|
||||||
read -p "Enter YOUR git repo url: " git_url
|
read -p "Enter YOUR git repo url: " git_url
|
||||||
|
@ -57,8 +57,10 @@ if [[ "${#sapphrc_bashrc}" -eq 0 ]];then
|
||||||
echo "done" >> $HOME/.bashrc
|
echo "done" >> $HOME/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $HOME/.cache/sapphrc/
|
if [ ! "$(crontab -l | grep -i 'sapphrc_updown')" ];then
|
||||||
crontab -l > $HOME/.cache/sapphrc/crontab
|
mkdir -p $HOME/.cache/sapphrc/
|
||||||
echo "*/15 * * * * sapphrc_updown" >> $HOME/.cache/sapphrc/crontab
|
crontab -l > $HOME/.cache/sapphrc/crontab
|
||||||
crontab $HOME/.cache/sapphrc/crontab
|
echo "*/15 * * * * sapphrc_updown" >> $HOME/.cache/sapphrc/crontab
|
||||||
rm $HOME/.cache/sapphrc/crontab
|
crontab $HOME/.cache/sapphrc/crontab
|
||||||
|
rm $HOME/.cache/sapphrc/crontab
|
||||||
|
fi
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./lib/sapphrc/sapphrc-functions
|
||||||
|
source ./lib/sapphrc/sapphrc-font
|
||||||
|
validate_backupdir
|
||||||
|
|
||||||
cd "$HOME/.config/sapphrc/backups"
|
cd "$HOME/.config/sapphrc/backups"
|
||||||
sapphrc_backup
|
sapphrc_backup
|
||||||
gs="$(git status | grep -i 'modified')"
|
gs="$(git status | grep -i 'modified')"
|
||||||
|
|
Loading…
Add table
Reference in a new issue