Skip to content

Commit

Permalink
Misc update
Browse files Browse the repository at this point in the history
  • Loading branch information
RustyTake-Off committed Oct 1, 2024
1 parent 75050f3 commit 9096d0b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/scripts/move_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 ''
Expand Down

0 comments on commit 9096d0b

Please sign in to comment.