Commit 6af54f95 authored by Ivan Yossi's avatar Ivan Yossi 👌 Committed by Ashwin Dhakaita

packaging macOS: Allow to set different styles from command args

Styles for the dmg are stored on a different file and can be selected using
-style="style file path". By default, if no option is given "default.styles" is used.

Styles can be created using "dmgstyle.sh" script.
parent 73da6ae3
......@@ -94,6 +94,21 @@ print_usage () {
get_script_dir() {
script_source="${BASH_SOURCE[0]}"
# go to target until finding root.
while [ -L "${script_source}" ]; do
script_target="$(readlink ${script_source})"
if [[ "${script_source}" = /* ]]; then
script_source="$script_target"
else
script_dir="$(dirname "${script_source}")"
script_source="${script_dir}/${script_target}"
fi
done
echo "$(dirname ${script_source})"
}
# Attempt to detach previous mouted DMG
......@@ -149,7 +164,6 @@ done
if [[ ! ${DMG_STYLE} ]]; then
<<<<<<< HEAD
=======
DMG_STYLE="${SCRIPT_SOURCE_DIR}/default.style"
>>>>>>> packaging macOS: Add custom Icon for dmg volume
fi
echo "Using style from: ${DMG_STYLE}"
......@@ -576,7 +590,6 @@ tell application "Finder"
#Set Icon for DMG
cp -v "${SCRIPT_SOURCE_DIR}/KritaIcon.icns" "/Volumes/${DMG_title}/.VolumeIcon.icns"
SetFile -a C "/Volumes/${DMG_title}"
>>>>>>> packaging macOS: Add custom Icon for dmg volume
chmod -Rf go-w "/Volumes/${DMG_title}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment