cordova-import-npm
Advanced tools
Comparing version 1.0.29 to 1.0.30
{ | ||
"name": "cordova-import-npm", | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"description": "Import files from npm packages into your cordova www directory automatically, upon cordova prepare or cordova build", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -14,5 +14,9 @@ #!/usr/bin/env node | ||
// the directory from which the command npx is being called/run | ||
// which according to setup instructions is the root directory of the main module which depends on this module | ||
const projectRootDirectory = process.env.INIT_CWD || process.cwd() | ||
const isTest = process.argv[2] === '--test' | ||
if (!isTest) { | ||
console.log('Setup script called from ' + colors.cyan(process.env.INIT_CWD)) | ||
console.log('Setup script called from ' + colors.cyan(projectRootDirectory)) | ||
} | ||
@@ -24,3 +28,3 @@ | ||
? path.join(__dirname, '..', 'test', 'config.xml') | ||
: path.join(process.env.INIT_CWD || process.cwd(), 'config.xml') | ||
: path.join(projectRootDirectory, 'config.xml') | ||
@@ -81,3 +85,3 @@ console.log(`Editing config.xml:${colors.cyan(configXmlFileName)}`) | ||
const jsonFile = path.join(process.env.INIT_CWD, 'npmFilesToImport.json') | ||
const jsonFile = path.join(projectRootDirectory, 'npmFilesToImport.json') | ||
@@ -84,0 +88,0 @@ try { |
352217
1375
5