mozilla-jetpack / jpm

Jetpack Manager for Node.js
https://www.npmjs.org/package/jpm
Mozilla Public License 2.0
164 stars 75 forks source link

Unable to set xpiPath option when creating XPI #329

Open pdehaan opened 9 years ago

pdehaan commented 9 years ago

I'm trying to create an XPI and save it to a specific directory, but am having issues.

None of these seem to currently be working:

$ ./node_modules/.bin/jpm xpi --xpiPath=dist/
  error: unknown option `--xpiPath`

$ ./node_modules/.bin/jpm xpi --xpi-path=dist/
  error: unknown option `--xpi-path`
pdehaan commented 9 years ago

Current output from --help is:

$ ./node_modules/.bin/jpm xpi --help

  Usage: xpi [options]

  Bundle the addon into an .xpi file

  Options:

    -h, --help  output usage information

But there isn't any information on how to specify [options] or what options are available.

noehmeier commented 8 years ago

Having also the same problem and it would be fine if there is a opportunity to set a path parameter.

pdehaan commented 8 years ago

I think I figured it out. I had to hack the commander option()s and add my own option for --xpi-path:

  .option("--xpi-path <path>", "path to xpi thing")

Then I just create a temp directory where I want to put my generated XPI path and specify the --xpi-path on the CLI, like-a-so:

$ mkdir tmp
$ ./node_modules/.bin/jpm xpi --xpi-path tmp
JPM [info] Starting jpm xpi on activity-streams-experiment
JPM [info] Successfully created XPI at tmp/@activity-streams-0.0.1.xpi (4035ms)

That puts the XPi where I want it, but I can't find a way to specify a filename or format so I can remove that unwanted leading @ in the filename (but I'm not even sure if that's allowed).