You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
In order to have properly read the package.json, when the cli app is installed globally I have to reference the package.json this way. better solutions appreciated.
var path = require('path');
var cli = require('cli');
var theFolder = path.dirname(require.main.filename);
var theFile = path.resolve(theFolder + '/../package.json');
cli.setApp(theFile);
Ciao
:m
The text was updated successfully, but these errors were encountered:
That said, that's only better in that it’s a one-liner.
This actually is also true if cli is installed as a local package. The documentation seems to imply that the default behavior of appname --version would return the appname's version. But in fact you get cli's version, not your appname. You end up explicitly defining the app's package as above.
@chriso Is this intended behavior? If so, an update to the docs to make this a little clearer would be useful.
Hello,
In order to have properly read the package.json, when the cli app is installed globally I have to reference the package.json this way. better solutions appreciated.
Ciao
:m
The text was updated successfully, but these errors were encountered: