diff options
author | Toby Vincent <tobyv13@gmail.com> | 2021-07-01 17:31:10 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2021-07-01 17:31:10 -0500 |
commit | 7c38faee96edd79619b4aee8b99e3b3546335aec (patch) | |
tree | 3aa696372a5d787b716f09db474e739905672ff7 /scripts/git-split.sh | |
parent | c265c6798cfcd22c3b1ad57ca2ab82e0f3d9766f (diff) |
refactor: moved artifact files array to be more obvious
Diffstat (limited to 'scripts/git-split.sh')
-rwxr-xr-x | scripts/git-split.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/git-split.sh b/scripts/git-split.sh index 06e6c8c..9ce9f49 100755 --- a/scripts/git-split.sh +++ b/scripts/git-split.sh @@ -16,6 +16,15 @@ fi eval set -- "$TEMP" SCRIPT="$(basename $0)" +ARTIFACTS=(".gitignore" ".gitattributes" ".vscode" "LICENSE") +VERBOSE=false +DEBUG=false +CONFIRMED=false +SUBMODULE=false +REPO=$(git rev-parse --show-toplevel) +DIRECTORY="$(basename $(git rev-parse --show-prefix))" +REMOTE="$(basename $DIRECTORY)/$(git config user.username)" +VISIBILITY="--public" read -r -d '' USAGE <<-EOF USAGE: $SCRIPT [OPTIONS] @@ -40,14 +49,6 @@ ARGS: defaults to current directory EOF -VERBOSE=false -DEBUG=false -CONFIRMED=false -SUBMODULE=false -REPO=$(git rev-parse --show-toplevel) -DIRECTORY="$(basename $(git rev-parse --show-prefix))" -REMOTE="$(basename $DIRECTORY)/$(git config user.username)" -VISIBILITY="--public" while true; do case "$1" in @@ -105,8 +106,7 @@ cd "$(mktemp -d)" git init && git pull $REPO $DIRECTORY && git branch -M main -files=(".gitignore" ".gitattributes" ".vscode" "LICENSE") -for f in "${files[@]}"; do +for f in "${ARTIFACTS[@]}"; do if [[ ! -e "./${f}" && -e "${REPO}/${f}" ]]; then printf '%s\n' "Copying ${f} to new repository..." cp -r "${REPO}/${f}" ./ |