pathmodify icon indicating copy to clipboard operation
pathmodify copied to clipboard

command-line usage: .pathmodifyrc or ?

Open dey-dey opened this issue 10 years ago • 4 comments

been looking for something like this that actually works for a while, so thank you!

i'm curious if you'd accept PRs for setting config from command line. something like:

browserify index.js -o build/bundle.js -p [ pathmodify --config ./.pathmodifyrc ]

that way you can configure it for tools that don't allow programmatic configuration.

dey-dey avatar Dec 19 '15 20:12 dey-dey

or simply checking for rc file

dey-dey avatar Dec 19 '15 20:12 dey-dey

Thanks @daedelus-j!

Doing something like this has crossed my mind. I don't use the CLI, so it hasn't been a high priority. Let me consider this.

Considering that you'd have to create a new file anyway, if you need this right now you can probably do something like:

var
  pathmodify = require("pathmodify");

module.exports = function (b, opts) {
  if (opts.cfgFile) {
    opts = require(opts.cfgFile);
  }
  return pathmodify(b, opts);
};
browserify index.js -o build/bundle.js -p [ ./pathmodify --cfg-file ./.pathmodifyrc ]

(Or just embed the cfg directly in that file if you prefer.)

jmm avatar Dec 21 '15 16:12 jmm

good point :) this is easier. mind if i add this to the docs?

dey-dey avatar Dec 23 '15 15:12 dey-dey

Thanks @daedelus-j! That sounds good, I just want to figure out where it should go. I want to keep the README focused. This is the second time something like this has come up, so I'm thinking of creating another page of docs about integrations and / or an examples directory.

jmm avatar Dec 25 '15 02:12 jmm