From 7c38faee96edd79619b4aee8b99e3b3546335aec Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Thu, 1 Jul 2021 17:31:10 -0500 Subject: refactor: moved artifact files array to be more obvious --- scripts/git-split.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'scripts') 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}" ./ -- cgit v1.2.3-70-g09d2