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}"
|
||||
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 $@
|
||||
}
|
||||
|
||||
updown() {
|
||||
sapphrc_updown $@
|
||||
}
|
||||
|
||||
push() {
|
||||
sapphrc_push $@
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "Sapphic Package Manager v${VERSION}"
|
||||
cat ./usr/share/doc/sapphrc/sapphrc
|
||||
|
@ -29,7 +37,7 @@ usage() {
|
|||
}
|
||||
|
||||
case $COMMAND in
|
||||
setup|profile|backup|restore )
|
||||
setup|profile|backup|restore|updown|push )
|
||||
shift 1;;&
|
||||
setup )
|
||||
setup $@;;
|
||||
|
@ -39,6 +47,10 @@ case $COMMAND in
|
|||
backup $@;;
|
||||
restore )
|
||||
restore $@;;
|
||||
updown )
|
||||
updown $@;;
|
||||
push )
|
||||
push $@;;
|
||||
*|usage )
|
||||
usage;;
|
||||
esac
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
sapphrc_config="$HOME/.config/sapphrc"
|
||||
|
||||
cat "${sapphrc_config}/active_profiles" | while read profile_name
|
||||
|
|
|
@ -4,6 +4,7 @@ COMMAND=$1
|
|||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
inex="exclude"
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ COMMAND=$1
|
|||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
inex="include"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
COMMAND="${1}"
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
cd "$HOME/.config/sapphrc/backups"
|
||||
git add .;
|
||||
git add -u;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
cd "$HOME/.config/sapphrc/backups"
|
||||
git pull --no-edit
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
sapphrc_config="$HOME/.config/sapphrc"
|
||||
if [ -f "${aspphic_config}/.init_complete" ];then
|
||||
echo "already setup"
|
||||
|
@ -11,7 +10,7 @@ mkdir -p "${sapphrc_config}"
|
|||
mkdir -p "${HOME}/.sapphrc"
|
||||
|
||||
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
|
||||
[Yy] )
|
||||
read -p "Enter YOUR git repo url: " git_url
|
||||
|
@ -36,7 +35,8 @@ while true;do
|
|||
mkdir -p "${sapphrc_config}/backups"
|
||||
cd "${sapphrc_config}/backups"
|
||||
git init
|
||||
git add "${sapphrc_config}/backups/."
|
||||
touch ./active_profiles
|
||||
git add .
|
||||
git commit -m "first commit"
|
||||
git branch -M main
|
||||
read -p "Enter YOUR git repo url: " git_url
|
||||
|
@ -57,8 +57,10 @@ if [[ "${#sapphrc_bashrc}" -eq 0 ]];then
|
|||
echo "done" >> $HOME/.bashrc
|
||||
fi
|
||||
|
||||
if [ ! "$(crontab -l | grep -i 'sapphrc_updown')" ];then
|
||||
mkdir -p $HOME/.cache/sapphrc/
|
||||
crontab -l > $HOME/.cache/sapphrc/crontab
|
||||
echo "*/15 * * * * sapphrc_updown" >> $HOME/.cache/sapphrc/crontab
|
||||
crontab $HOME/.cache/sapphrc/crontab
|
||||
rm $HOME/.cache/sapphrc/crontab
|
||||
fi
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./lib/sapphrc/sapphrc-functions
|
||||
source ./lib/sapphrc/sapphrc-font
|
||||
validate_backupdir
|
||||
|
||||
cd "$HOME/.config/sapphrc/backups"
|
||||
sapphrc_backup
|
||||
gs="$(git status | grep -i 'modified')"
|
||||
|
|
Loading…
Add table
Reference in a new issue