2022-11-08 11:52:13

This commit is contained in:
2022-11-08 11:52:14 -05:00
parent 7d52d88723
commit 3287ec3afa
2 changed files with 5 additions and 2 deletions

View File

@@ -23,13 +23,14 @@ sprj(){
# new project # new project
function new(){ function new(){
prjroot="/cygdrive/p/project_notes/" prjroot="/cygdrive/p/project_notes/"
winprjroot="p:/project_notes/"
editor="/cygdrive/c/Program Files/Sublime\ Text/subl.exe" editor="/cygdrive/c/Program Files/Sublime\ Text/subl.exe"
if [[ -z $1 ]]; then echo 'i need the project name, bae'; exit 1; else prjname=$(echo $1|sed -e 's/ /-/g'); fi if [[ -z $1 ]]; then echo 'i need the project name, bae'; exit 1; else prjname=$(echo $1|sed -e 's/ /-/g'); fi
lastnum=$(find $prjroot. -type d -maxdepth 1 -iname "*[0-9]*" | grep -oP '(?<=\/)([0-9]+)(?=\.)' | sort | tail -1) lastnum=$(find $prjroot. -type d -maxdepth 1 -iname "*[0-9]*" | grep -oP '(?<=\/)([0-9]+)(?=\.)' | sort | tail -1)
prjnum=$(echo $lastnum | awk -F, '{printf("%04d",($lastnum".")+1)}') prjnum=$(echo $lastnum | awk -F, '{printf("%04d",($lastnum".")+1)}')
prjname="$prjnum.$prjname" prjname="$prjnum.$prjname"
mkdir -p $prjroot$prjname || echo "cannot mkdir '$prjroot$prjname'" && exit 1 mkdir -p $prjroot$prjname || echo "cannot mkdir '$prjroot$prjname'" && exit 1
touch $prjroot$prjname/$prjname.txt && $editor $prjroot$prjname/$prjname.txt touch $prjroot$prjname/$prjname.txt && $editor $winprjroot$prjname/$prjname.txt
if [[ -f .git ]]; then git branch -b $prjname; else echo "no '.git' found"; fi if [[ -f .git ]]; then git branch -b $prjname; else echo "no '.git' found"; fi
} }
@@ -43,3 +44,5 @@ function gcq(){
if [[ -z $1 ]]; then msg="$(date +%F\ %T)"; else msg=$1; fi if [[ -z $1 ]]; then msg="$(date +%F\ %T)"; else msg=$1; fi
git commit -am "$msg" && read -n1 -p "push? [Y/n] " reply; if [[ $reply != [Nn] ]]; then git push; fi git commit -am "$msg" && read -n1 -p "push? [Y/n] " reply; if [[ $reply != [Nn] ]]; then git push; fi
} }
alias gs='git status'

View File

@@ -243,7 +243,7 @@ done
if [[ $MASTER_HOST && $MASTER_USER && $MASTER_PASSWORD ]]; then if [[ $MASTER_HOST && $MASTER_USER && $MASTER_PASSWORD ]]; then
hecko "\napplying configuration for replication\n\thost: $MASTER_HOST\n\tuser: $MASTER_USER" hecko "\napplying configuration for replication\n\thost: $MASTER_HOST\n\tuser: $MASTER_USER"
xct "mysql -e 'CHANGE MASTER TO master_host=$MASTER_HOST,master_user=$MASTER_USER,master_password=$MASTER_PASSWORD;'" xct 'mysql -e "CHANGE MASTER TO master_host=$MASTER_HOST,master_user=$MASTER_USER,master_password=$MASTER_PASSWORD;"'
else else
hecko "\nwarning: replication credentials not present; this might be bad if replication host is not already configured" hecko "\nwarning: replication credentials not present; this might be bad if replication host is not already configured"
fi fi