Skip to content

Commit

Permalink
Merge pull request #43 from andstor/develop
Browse files Browse the repository at this point in the history
v3.2.2
  • Loading branch information
andstor authored Jun 13, 2020
2 parents f78bae4 + f37cc23 commit 0d78a5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org).

## [Unreleased]

## [3.2.2] - 2020-06-13
### Fixed
- Proper handling of spaces in path names.

## [3.2.1] - 2020-04-21
### Fixed
- Fixed an error regarding creation of destination branches.
Expand Down Expand Up @@ -42,7 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org).

## 1.0.0 - 2019-07-09

[Unreleased]: https://github.com/andstor/copycat-action/compare/v3.2.1...HEAD
[Unreleased]: https://github.com/andstor/copycat-action/compare/v3.2.2...HEAD
[3.2.2]: https://github.com/andstor/copycat-action/compare/v3.2.1...v3.2.2
[3.2.1]: https://github.com/andstor/copycat-action/compare/v3.2.0...v3.2.1
[3.2.0]: https://github.com/andstor/copycat-action/compare/v3.1.1...v3.2.0
[3.1.1]: https://github.com/andstor/copycat-action/compare/v3.1.0...v3.1.1
Expand Down
19 changes: 11 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
#
# @author André Storhaug <[email protected]>
# @date 2020-04-18
# @date 2020-06-13
# @license MIT
# @version 3.2.1
# @version 3.2.2

set -o pipefail

Expand Down Expand Up @@ -98,15 +98,18 @@ if [[ -n "$FILTER" ]]; then
mkdir ${temp_dir}/${SRC_REPO_NAME}
cd ${SRC_REPO_NAME}
FINAL_SOURCE="${tmp_dir}/${SRC_REPO_NAME}/${SRC_PATH}"
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in ${FILTER} ; do
[ -e "$f" ] || continue
[ -d "$f" ] && continue
if [[ -n "$EXCLUDE" ]] ; then
[[ $f == $EXCLUDE ]] && continue
[[ "$f" == $EXCLUDE ]] && continue
fi
file_dir=$(dirname "${f}")
mkdir -p ${tmp_dir}/${SRC_REPO_NAME}/${file_dir} && cp "${f}" ${tmp_dir}/${SRC_REPO_NAME}/${file_dir}
mkdir -p "${tmp_dir}/${SRC_REPO_NAME}/${file_dir}" && cp "${f}" "${tmp_dir}/${SRC_REPO_NAME}/${file_dir}"
done
IFS=$SAVEIFS
cd ..
fi

Expand All @@ -127,16 +130,16 @@ fi

if [ "$CLEAN" = "true" ]; then
if [ -f "${DST_REPO_NAME}/${DST_PATH}" ] ; then
find ${DST_REPO_NAME}/${DST_PATH} -type f -not -path '*/\.git/*' -delete
find "${DST_REPO_NAME}/${DST_PATH}" -type f -not -path '*/\.git/*' -delete
elif [ -d "${DST_REPO_NAME}/${DST_PATH}" ] ; then
find ${DST_REPO_NAME}/${DST_PATH%/*}/* -type f -not -path '*/\.git/*' -delete
find "${DST_REPO_NAME}/${DST_PATH%/*}"/* -type f -not -path '*/\.git/*' -delete
else
echo >&2 "Nothing to clean 🧽"
fi
fi

mkdir -p ${DST_REPO_NAME}/${DST_PATH%/*} || exit "$?"
cp -rf ${FINAL_SOURCE} ${DST_REPO_NAME}/${DST_PATH} || exit "$?"
mkdir -p "${DST_REPO_NAME}/${DST_PATH%/*}" || exit "$?"
cp -rf "${FINAL_SOURCE}" "${DST_REPO_NAME}/${DST_PATH}" || exit "$?"
cd ${DST_REPO_NAME} || exit "$?"

if [[ -z "${COMMIT_MESSAGE}" ]]; then
Expand Down

0 comments on commit 0d78a5b

Please sign in to comment.