You've already forked go-template-container-webserver
This commit is contained in:
@@ -107,7 +107,7 @@ while IFS= read -r clone_url; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
file_diff=$(git diff "${PREVIOUS_COMMIT_ID}" "${CURRENT_COMMIT_ID}" -- "${file}" 2>/dev/null || true)
|
file_diff=$(git diff "${PREVIOUS_COMMIT_ID}" "${CURRENT_COMMIT_ID}" -- "${file}" 2>/dev/null || true)
|
||||||
|
|
||||||
if [ -n "${file_diff}" ]; then
|
if [ -n "${file_diff}" ]; then
|
||||||
tmp_current=$(mktemp)
|
tmp_current=$(mktemp)
|
||||||
tmp_diff=$(mktemp)
|
tmp_diff=$(mktemp)
|
||||||
@@ -117,9 +117,11 @@ while IFS= read -r clone_url; do
|
|||||||
if patch --dry-run "${tmp_current}" "${tmp_diff}" >/dev/null 2>&1; then
|
if patch --dry-run "${tmp_current}" "${tmp_diff}" >/dev/null 2>&1; then
|
||||||
patch "${tmp_current}" "${tmp_diff}" >/dev/null 2>&1
|
patch "${tmp_current}" "${tmp_diff}" >/dev/null 2>&1
|
||||||
patched_content=$(cat "${tmp_current}")
|
patched_content=$(cat "${tmp_current}")
|
||||||
|
|
||||||
if [ "${current_content}" != "${patched_content}" ]; then
|
if [ "${current_content}" != "${patched_content}" ]; then
|
||||||
|
template_permissions=$(pushd "${TEMPLATE_REPO_DIR}" >/dev/null && stat -c "%a" "${file}" 2>/dev/null || echo "644" && popd >/dev/null)
|
||||||
echo "${patched_content}" > "${file}"
|
echo "${patched_content}" > "${file}"
|
||||||
|
chmod "${template_permissions}" "${file}" 2>/dev/null || true
|
||||||
git add "${file}"
|
git add "${file}"
|
||||||
files_changed=true
|
files_changed=true
|
||||||
echo "Merged updates for ${file} in ${repo_name}"
|
echo "Merged updates for ${file} in ${repo_name}"
|
||||||
@@ -138,6 +140,8 @@ while IFS= read -r clone_url; do
|
|||||||
echo "Adding new file ${file} from template to ${repo_name}"
|
echo "Adding new file ${file} from template to ${repo_name}"
|
||||||
mkdir -p "$(dirname "${file}")"
|
mkdir -p "$(dirname "${file}")"
|
||||||
echo "${template_content}" > "${file}"
|
echo "${template_content}" > "${file}"
|
||||||
|
template_permissions=$(pushd "${TEMPLATE_REPO_DIR}" >/dev/null && stat -c "%a" "${file}" 2>/dev/null || echo "644" && popd >/dev/null)
|
||||||
|
chmod "${template_permissions}" "${file}" 2>/dev/null || true
|
||||||
git add "${file}"
|
git add "${file}"
|
||||||
files_changed=true
|
files_changed=true
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user