diff --git a/index.js b/index.js index 6cccf7e..2b3db2c 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,13 @@ function forEachHook(pkgdir, callback) { var projectDir = findProjectDir(pkgdir); if (!projectDir) { - return; + // in case of plugins like file:../../plugin it would fail because + // pkgdir is the plugin actual dir which is not "inside" the app project folder. + if (_isNativeScriptAppRoot(process.cwd())) { + projectDir = process.cwd(); + } else { + return; + } } var hooksDir = path.join(projectDir, 'hooks');