Skip to content

Make the install directory configurable via an environment variable #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions aliases/flow/feature.publish.sh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions aliases/flow/feature.start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion aliases/flow/help.sh
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
10 changes: 5 additions & 5 deletions aliases/flow/hotfix.publish.sh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions aliases/flow/hotfix.start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions aliases/flow/init.sh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion aliases/flow/release.all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
BRANCH=$1;

# Imports
. $HOME/gitflow/modules/verify.sh
. "${AZ_GITFLOW_DIR}/modules/verify.sh"

# Validations
verifyInGitRepo;
Expand Down
6 changes: 3 additions & 3 deletions aliases/flow/release.publish.sh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions aliases/flow/release.start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions aliases/general/clean.sh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions aliases/general/ignore.force.sh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
18 changes: 10 additions & 8 deletions install.bat
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
20 changes: 12 additions & 8 deletions install_macos.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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)";
Expand All @@ -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
Expand All @@ -45,6 +48,7 @@ for A in aliases/*; do
done
fi
done

bash temp_install.bash
popd

4 changes: 2 additions & 2 deletions modules/force.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
4 changes: 2 additions & 2 deletions modules/try.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
6 changes: 3 additions & 3 deletions modules/verify.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down