-
Notifications
You must be signed in to change notification settings - Fork 8
Advanced Nerd info
For some technical users, you may prefer to simply use APKManager from the command line. This is done by launching the main shell script (main.sh) directly. This file can be found in the apkmanager/other directory.
The script checks that it can find the main/root apkmanager directory and will generate an error if it can't. However, the script is also smart, and can detect if it has everything it needs to run from its current location on disk. For users comfortable with the command line, I recommend making a symbolic link to apkmanager/other/main.sh somewhere in your $PATH. If you invoke the script directly, there's an option inside APK Manager to set this up for you:
- Go to the debug menu (option 24)
- Select "Toggle "apkm" command line use" (option 9)
This calls a function to check if /usr/local/bin is in your path, and if so, create a symlink to main.sh where it currently resides on disk. (yeah, the check to make sure /usr/local/bin is in $PATH is a bit paranoid, but well, some people actually edit the /etc/paths file.)
if [[ $(echo $PATH | grep -m1 /usr/local/bin) ]]; then
if [[ $(command -v apkm) = /usr/local/bin/apkm ]]; then
echo "deleting apkm symlink in /usr/local/bin" 1>> "$log"
rm "/usr/local/bin/apkm"
elif [[ ! $(command -v apkm) ]]; then
echo "creating apkm symlink in /usr/local/bin" 1>> "$log"
ln -s -F "$maindir/other/main.sh" "/usr/local/bin/apkm"; chmod ug+x "/usr/local/bin/apkm"
fi
fi