File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -26,19 +26,12 @@ git config --global user.name "$DESTINATION_GITHUB_USERNAME"
26
26
git clone --single-branch --branch " $TARGET_BRANCH " " https://$API_TOKEN_GITHUB @github.com/$DESTINATION_REPOSITORY_USERNAME /$DESTINATION_REPOSITORY_NAME .git" " $CLONE_DIR "
27
27
ls -la " $CLONE_DIR "
28
28
29
- echo " Cleaning destination repository of old files"
30
- # Deletes the contents of $CLONE_DIR with three exceptions (! -path "..."):
31
- # -Skips the $CLONE_DIR/ directory itself
32
- # -Skips the contents of $CLONE_DIR/.git/*
33
- # -Skips the $CLONE_DIR/.git
34
- find " $CLONE_DIR /" ! -path " $CLONE_DIR /" ! -path " $CLONE_DIR /.git/*" ! -path " $CLONE_DIR /.git" -exec rm -rf {} \;
35
-
36
- echo " Contents of $CLONE_DIR after deleting everything but .git"
37
- ls -la " $CLONE_DIR "
29
+ TARGET_DIR=$( mktemp -d)
30
+ mv " $CLONE_DIR /.git" " $TARGET_DIR "
38
31
39
32
echo " Copying contents to git repo"
40
- cp -r " $SOURCE_DIRECTORY " /* " $CLONE_DIR "
41
- cd " $CLONE_DIR "
33
+ cp -ra " $SOURCE_DIRECTORY " /. " $TARGET_DIR "
34
+ cd " $TARGET_DIR "
42
35
43
36
echo " Files that will be pushed"
44
37
ls -la
You can’t perform that action at this time.
0 commit comments