Reputation: 11
i want to check if adb is already set on variable path before to do an export like
export PATH=$PATH:~/.android-sdk-macosx/platform-tools/
in the installation of the package.
i try with a condition like that
if ! command -v ADB &> /dev/null
then
echo "ADB could not be found"> /tmp/my_postinstall.log
else
echo "ADB is found"> /tmp/my_postinstall.log
fi
it's working in the terminal, but not the postinstall script (which is executable)
what i have forgotten?
thanks
Upvotes: 0
Views: 161
Reputation: 529
The postinstall script does not run in any user context, and therefore doesn't inherit a given user's $PATH
. Running source /Users/username/.bash_profile
will update the $PATH
your script sees to match that of the user's you want to check.
Upvotes: 1