diff --git a/.github/scripts/move_files.sh b/.github/scripts/move_files.sh index b83d5e0..ffe4ae7 100644 --- a/.github/scripts/move_files.sh +++ b/.github/scripts/move_files.sh @@ -26,20 +26,20 @@ git reset > /dev/null # Checkout necessary files and directories git checkout "$SOURCE_BRANCH_NAME" -- $TARGET_BRANCH_NAME > /dev/null -[[ -n "$OTHER_DIRS_FILES" ]] \ +[ -n "$OTHER_DIRS_FILES" ] \ && git checkout "$SOURCE_BRANCH_NAME" -- $OTHER_DIRS_FILES > /dev/null # Copy files and directories cp -r "$TARGET_BRANCH_NAME"/* . find "$TARGET_BRANCH_NAME" -maxdepth 1 -name '.*[!.]*' -exec cp -r {} . \; -if [[ -n "$OTHER_DIRS_FILES" ]]; then +if [ -n "$OTHER_DIRS_FILES" ]; then shopt -s dotglob for item in $OTHER_DIRS_FILES; do - if [[ -f "$item" ]] && [[ -s "$item" ]]; then + if [ -f "$item" ] && [ -s "$item" ]; then cp "$item" . - elif [[ -d "$item" ]]; then + elif [ -d "$item" ]; then cp -r "$item" . fi done @@ -51,11 +51,11 @@ fi rm -rf "$TARGET_BRANCH_NAME" rm README.md to_move.yaml -if [[ -n "$OTHER_DIRS_FILES" ]]; then +if [ -n "$OTHER_DIRS_FILES" ]; then for item in $OTHER_DIRS_FILES; do dir=$(dirname "$item") - [[ -d "$dir" ]] && rm -rf "$dir" + [ -d "$dir" ] && rm -rf "$dir" done fi @@ -66,7 +66,7 @@ git config --global user.email "$USER_EMAIL" git add --all -if [[ -z "$(git diff --staged)" ]]; then +if [ -z "$(git diff --staged)" ]; then echo '' echo '=== No changes to commit ============' echo ''