bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-08-02 06:53:54 +03:00
parent 1ad023e440
commit 4c37f89150
3 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,7 @@
(function(require){ var module={} // make module AMD/node compatible...
/*********************************************************************/
var path = require('path')
var object = require('ig-object')
@ -133,11 +134,12 @@ function(name, pre, post){
var getFromPackage =
module.extra.getFromPackage =
function(attr){
var dir = path.dirname((require.main || {}).filename || '.')
return function(path){
try {
return require(path
|| this.packageJson
|| './package.json')[attr]
|| dir +'/package.json')[attr]
} catch(err){
return undefined } } }

View File

@ -106,5 +106,8 @@ argv.Parser({
__filename == (require.main || {}).filename
&& parser()
// vim:set ts=4 sw=4 spell :

View File

@ -1,6 +1,6 @@
{
"name": "ig-argv",
"version": "2.10.0",
"version": "2.10.1",
"description": "simple argv parser",
"main": "argv.js",
"scripts": {