Oh, I think I see what’s going on here. Looking at your screen shot of the build log, I see this:
PrefPane destination path: /Users/ivantonchev~/Library/PreferencePanes/
Note how the ~
is embedded in the path. That’s because your script has this:
PREFPANE_DST="$HOME~/Library/PreferencePanes/"
$HOME
expands to the user’s home directory, so you don’t need the ~
(which would do the same thing if you put it outside of the quotes). Consider this:
% echo "$HOME~/Library/PreferencePanes/"
/Users/quinn~/Library/PreferencePanes/
% echo "$HOME/Library/PreferencePanes/"
/Users/quinn/Library/PreferencePanes/
% echo ~"/Library/PreferencePanes/"
/Users/quinn/Library/PreferencePanes/
The first one is wrong; the second two are right.
Also, I recommend that you add a set -e
to your script. That way it’ll fail if any command fails. Consider:
% cat test.sh
#! /bin/sh
set -e
echo "before"
false
echo "after"
% ./test.sh
before
Note how the script doesn’t print after
. If you remove the set -e
it will, and this continue-after-failure behaviour is quite confusing.
Oh, one last thing: Don’t copy code using cp
. Use ditto
instead, because it does the right thing with symlinks. And it’s best to completely remove the previous item beforehand, lest you be hit by this issue.
I'm inexperienced in macOS development
No worries. I learnt a lot of this the hard way. Let’s hope you can avoid that pain (-:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"