aboutsummaryrefslogtreecommitdiffhomepage
path: root/build_tools/osx_package_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools/osx_package_scripts')
-rwxr-xr-xbuild_tools/osx_package_scripts/add-shell11
1 files changed, 8 insertions, 3 deletions
diff --git a/build_tools/osx_package_scripts/add-shell b/build_tools/osx_package_scripts/add-shell
index 3544ebfc..d12fc062 100755
--- a/build_tools/osx_package_scripts/add-shell
+++ b/build_tools/osx_package_scripts/add-shell
@@ -21,7 +21,7 @@ tmpfile=${file}.tmp
set -o noclobber
trap "rm -f $tmpfile" EXIT
-
+
if ! cat $file > $tmpfile
then
cat 1>&2 <<EOF
@@ -31,11 +31,16 @@ EOF
exit 1
fi
+# Append a newline if it doesn't exist
+if [ "$(tail -c1 "$tmpfile"; echo x)" != $'\nx' ]; then
+ echo "" >> "$tmpfile"
+fi
+
for i
do
- if ! grep -q "^${i}$" $tmpfile
+ if ! grep -q "^${i}$" "$tmpfile"
then
- echo $i >> $tmpfile
+ echo $i >> "$tmpfile"
fi
done