Skip to content

Instantly share code, notes, and snippets.

@MiqViq
Last active August 29, 2016 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiqViq/b38b05bab10d4d7ab4e6 to your computer and use it in GitHub Desktop.
Save MiqViq/b38b05bab10d4d7ab4e6 to your computer and use it in GitHub Desktop.
postinstall for eDocker InDesign plugins
#!/bin/bash
# postinstall script for eDocker3_CREATE_silent
#
# created by MiqViq on 2015.10.2
#
# version: 3.3.3.20151002
#
# installer environment variables:
# $0 path to This Script
# $1 path of Current package
# $2 path to Default Target location defined in pkg settings
# $3 path to selected Target volume
pathToScript="${0}"
pathToInstallerPkg="${1}"
pathToDefaultTarget="${2}"
if [ "${3}" == "/" ]; then
targetVolume=""
else
targetVolume="${3}"
fi
###
# script functions
###
# script actions
IFS=$'\n'
edtSrcDir="${targetVolume}/Applications/eDockerCREATE.app/Contents/Resources/tools/Panels/eDockerTools"
if [ ! -r "${edtSrcDir}" ]; then
echo "ERROR: No access to '${edtSrcDir}'"
exit 1
fi
getIndyPlugDirs=$(for app in "${targetVolume}"/Applications/Adobe\ InDesign\ C*/*.app; do plugsDir="$(dirname "${app}")/Plug-Ins"; if [ -d "${plugsDir}" ]; then echo "${plugsDir}";fi; done)
if [ "" == "${getIndyPlugDirs}" ]; then
echo "ERROR: No valid InDesign installations at '${targetVolume}/Applications'"
exit 1
fi
echo "${getIndyPlugDirs}"
for PlugsDir in ${getIndyPlugDirs}
do
edtTgtDir="${PlugsDir}/Panels/eDockerTools"
rm -rf "${edtTgtDir}"
mkdir -p -m 0777 "${edtTgtDir}"
cp -r "${edtSrcDir}/" "${edtTgtDir}"
chmod -R ug+rw,a+rX "${edtTgtDir}"
chown -R 0:80 "${edtTgtDir}"
echo "Installed eDocker Panel to '${edtTgtDir}'"
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment