diff --git a/aliases/flow/feature.publish.sh b/aliases/flow/feature.publish.sh index 0c07f79..5f934bb 100644 --- a/aliases/flow/feature.publish.sh +++ b/aliases/flow/feature.publish.sh @@ -1,11 +1,11 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/force.sh -. $HOME/gitflow/modules/get.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/force.sh" +. "${AZ_GITFLOW_DIR}/modules/get.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/feature.start.sh b/aliases/flow/feature.start.sh index 9c531b2..5f98cec 100644 --- a/aliases/flow/feature.start.sh +++ b/aliases/flow/feature.start.sh @@ -4,10 +4,10 @@ BRANCH=$1; # Imports -. $HOME/gitflow/modules/force.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/force.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/help.sh b/aliases/flow/help.sh index 0d90b61..d5f08d3 100644 --- a/aliases/flow/help.sh +++ b/aliases/flow/help.sh @@ -1,7 +1,7 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/show.sh +. "${AZ_GITFLOW_DIR}/modules/show.sh" # Process # cp $HOME/gitflow/config/md.nanorc /usr/share/nano/ diff --git a/aliases/flow/hotfix.publish.sh b/aliases/flow/hotfix.publish.sh index 4a50190..f09b74e 100644 --- a/aliases/flow/hotfix.publish.sh +++ b/aliases/flow/hotfix.publish.sh @@ -1,11 +1,11 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/force.sh -. $HOME/gitflow/modules/get.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/force.sh" +. "${AZ_GITFLOW_DIR}/modules/get.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/hotfix.start.sh b/aliases/flow/hotfix.start.sh index 1c10f54..c58226f 100644 --- a/aliases/flow/hotfix.start.sh +++ b/aliases/flow/hotfix.start.sh @@ -4,10 +4,10 @@ BRANCH=$1; # Imports -. $HOME/gitflow/modules/force.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/force.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/init.sh b/aliases/flow/init.sh index 5aecc78..6eca2ba 100644 --- a/aliases/flow/init.sh +++ b/aliases/flow/init.sh @@ -1,10 +1,10 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/force.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/force.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/release.all.sh b/aliases/flow/release.all.sh index 54e2b1c..092cd81 100644 --- a/aliases/flow/release.all.sh +++ b/aliases/flow/release.all.sh @@ -4,7 +4,7 @@ BRANCH=$1; # Imports -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/release.publish.sh b/aliases/flow/release.publish.sh index eebfca6..7bce6b5 100644 --- a/aliases/flow/release.publish.sh +++ b/aliases/flow/release.publish.sh @@ -1,9 +1,9 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/get.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/get.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/flow/release.start.sh b/aliases/flow/release.start.sh index 50d1401..c98cdad 100644 --- a/aliases/flow/release.start.sh +++ b/aliases/flow/release.start.sh @@ -4,10 +4,10 @@ BRANCH=$1; # Imports -. $HOME/gitflow/modules/force.sh -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/force.sh" +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/general/clean.sh b/aliases/general/clean.sh index 5339f77..a2a5666 100644 --- a/aliases/general/clean.sh +++ b/aliases/general/clean.sh @@ -1,9 +1,9 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/try.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/try.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/aliases/general/ignore.force.sh b/aliases/general/ignore.force.sh index e7a2513..b1a5bd6 100644 --- a/aliases/general/ignore.force.sh +++ b/aliases/general/ignore.force.sh @@ -1,8 +1,8 @@ #!/bin/bash # Imports -. $HOME/gitflow/modules/show.sh -. $HOME/gitflow/modules/verify.sh +. "${AZ_GITFLOW_DIR}/modules/show.sh" +. "${AZ_GITFLOW_DIR}/modules/verify.sh" # Validations verifyInGitRepo; diff --git a/install.bat b/install.bat index e1e99f7..1d97a73 100644 --- a/install.bat +++ b/install.bat @@ -1,13 +1,15 @@ ECHO OFF -rmdir /S /Q %userprofile%\gitflow\ -mkdir %userprofile%\gitflow\ -xcopy /E /Y HELP.md %userprofile%\gitflow\ -xcopy /E /Y config %userprofile%\gitflow\config\ -xcopy /E /Y modules %userprofile%\gitflow\modules\ -xcopy /E /Y aliases %userprofile%\gitflow\aliases\ - -pushd %userprofile%\gitflow\ +SET AZ_GITFLOW_DIR=%userprofile%\gitflow\ + +rmdir /S /Q %AZ_GITFLOW_DIR% +mkdir %AZ_GITFLOW_DIR% +xcopy /E /Y HELP.md %AZ_GITFLOW_DIR% +xcopy /E /Y config %AZ_GITFLOW_DIR%\config\ +xcopy /E /Y modules %AZ_GITFLOW_DIR%\modules\ +xcopy /E /Y aliases %AZ_GITFLOW_DIR%\aliases\ + +pushd %AZ_GITFLOW_DIR% copy NUL temp_install.bat FOR /f %%A IN ('dir /b aliases') DO ( FOR /f %%S IN ('dir /b aliases\%%A\*.sh') DO ( diff --git a/install_macos.sh b/install_macos.sh old mode 100644 new mode 100755 index 374429e..b8a502f --- a/install_macos.sh +++ b/install_macos.sh @@ -1,5 +1,8 @@ #!/bin/bash +# TODO: update to allow config via args +AZ_GITFLOW_DIR=${AZ_GITFLOW_DIR:-"${HOME}/gitflow"} + function PROCESS_ALIAS() { local aliasName="alias.$(basename $1).$(basename $2)"; @@ -24,14 +27,14 @@ function PROCESS_BAT() } set +v -rm -Rf ~/gitflow/ -mkdir ~/gitflow/ -cp -f HELP.md ~/gitflow/ -cp -Rf config ~/gitflow/config/ -cp -Rf modules ~/gitflow/modules/ -cp -Rf aliases ~/gitflow/aliases/ - -pushd ~/gitflow/ +rm -Rf "${AZ_GITFLOW_DIR}" +mkdir "${AZ_GITFLOW_DIR}" +cp -f HELP.md "${AZ_GITFLOW_DIR}" +cp -Rf config "${AZ_GITFLOW_DIR}/config/" +cp -Rf modules "${AZ_GITFLOW_DIR}/modules/" +cp -Rf aliases "${AZ_GITFLOW_DIR}/aliases/" + +pushd "${AZ_GITFLOW_DIR}" echo "#!/bin/bash" > temp_install.bash for A in aliases/*; do if [ -d "${A}" ]; then @@ -45,6 +48,7 @@ for A in aliases/*; do done fi done + bash temp_install.bash popd diff --git a/modules/force.sh b/modules/force.sh index b4c62f2..ee55808 100644 --- a/modules/force.sh +++ b/modules/force.sh @@ -1,6 +1,6 @@ # Imports -. $HOME/gitflow/modules/get.sh; -. $HOME/gitflow/modules/try.sh; +. "${AZ_GITFLOW_DIR}/modules/get.sh"; +. "${AZ_GITFLOW_DIR}/modules/try.sh"; # Functions function forceBranchUpdateFromOrigin() diff --git a/modules/try.sh b/modules/try.sh index 2fe3576..976e381 100644 --- a/modules/try.sh +++ b/modules/try.sh @@ -1,6 +1,6 @@ # Imports -. $HOME/gitflow/modules/get.sh; -. $HOME/gitflow/modules/show.sh; +. "${AZ_GITFLOW_DIR}/modules/get.sh"; +. "${AZ_GITFLOW_DIR}/modules/show.sh"; # Functions function tryRebase() diff --git a/modules/verify.sh b/modules/verify.sh index 6464c94..2001ea4 100644 --- a/modules/verify.sh +++ b/modules/verify.sh @@ -1,7 +1,7 @@ # Imports -. $HOME/gitflow/modules/get.sh; -. $HOME/gitflow/modules/show.sh; -. $HOME/gitflow/modules/try.sh; +. "${AZ_GITFLOW_DIR}/modules/get.sh"; +. "${AZ_GITFLOW_DIR}/modules/show.sh"; +. "${AZ_GITFLOW_DIR}/modules/try.sh"; # Functions function verifyInGitRepo()