Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

pack-local-script: Match mode of file outside of packing.

Alex Vandiverb1f899512a18
diff --git a/puppet/kandra/files/install-ssh-authorized-keys b/puppet/kandra/files/install-ssh-authorized-keys
old mode 100644
new mode 100755
diff --git a/puppet/kandra/files/install-ssh-keys b/puppet/kandra/files/install-ssh-keys
old mode 100644
new mode 100755
diff --git a/tools/setup/pack-local-script b/tools/setup/pack-local-script
index 0cbe0e652b3..e8749d48706 100755
--- a/tools/setup/pack-local-script
+++ b/tools/setup/pack-local-script
@@ -13,10 +13,12 @@ set -eu
var="$1"
file="$2"
+mode="$(stat -c "%a" "$file")"
+
encoded="$(gzip --stdout "$file" | base64)"
cat <<embedded-shell-output
$var="\$(mktemp)"
-chmod 755 "\$$var"
+chmod "$mode" "\$$var"
base64 -d <<"encoded-shell-script" | gzip -d > "\$$var"
$encoded
encoded-shell-script