Phanx / wow-addon-updater

Install and update World of Warcraft addons from the command line on Linux
zlib License
4 stars 1 forks source link

Suggestion: Add wrapper shell script #17

Closed jukx closed 6 years ago

jukx commented 6 years ago

lua xxx.lua is a bit unwieldy. Consolidating both functions into one script makes a lot of sense, especially when you want to use the application from the command line in daily use.

The only issue would be to determine the AddOns directory.

I'm using this one:

#!/bin/sh

cd "/mnt/games/World of Warcraft/Interface/AddOns/updater"
if [[ -z $1 ]]; then
    lua update.lua
else
    lua install.lua "$@"
fi
Phanx commented 6 years ago

This should work:

  1. Replace the cd line with cd "$(dirname "$0")"
  2. Leave the script in the updater directory
  3. ln -s the script into a directory that's in your PATH

You can leave your shell script in the updater directory, ln -s it to somewhere in your PATH, use

jukx commented 6 years ago

Doesn't get the correct path to the script via $0 when you run the linked file. Another case of "which systems are going to be supported?" :(

Phanx commented 6 years ago

I definitely have some scripts up that way, though I may have misremembered the exact syntax. I'll check and report back.

jukx commented 6 years ago

Thanks, that would be great!

Phanx commented 6 years ago

Try cd "$(dirname "$(readlink -f "$0")")"