nativescript-hook
Advanced tools
Comparing version 0.2.0 to 0.2.1
16
index.js
@@ -13,3 +13,3 @@ module.exports = function (__dirname) { | ||
}; | ||
} | ||
}; | ||
@@ -21,2 +21,3 @@ var fs = require('fs'); | ||
var mkdirp = require('mkdirp'); | ||
var glob = require('glob'); | ||
@@ -62,3 +63,3 @@ function generateHookName(pkg, hook) { | ||
ns.hooks.forEach(function (hook) { | ||
callback(hooksDir, pkg, hook) | ||
callback(hooksDir, pkg, hook); | ||
}); | ||
@@ -68,2 +69,9 @@ } | ||
function hookInstalled(hookDir, pkg, hook) { | ||
var hookBaseName = pkg.name; | ||
var hookGlob = path.join(hookDir, "*" + hookBaseName + "*"); | ||
var files = glob.sync(hookGlob); | ||
return files.length > 0; | ||
} | ||
function postinstall(pkgdir) { | ||
@@ -75,2 +83,6 @@ forEachHook(pkgdir, function (hooksDir, pkg, hook) { | ||
} | ||
if (hookInstalled(hookDir, pkg, hook)) { | ||
console.log('Hook already installed: ' + pkg.name); | ||
return; | ||
} | ||
var hookFileName = generateHookName(pkg, hook); | ||
@@ -77,0 +89,0 @@ var hookPath = path.join(hookDir, hookFileName); |
{ | ||
"name": "nativescript-hook", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Helper module for installing hooks into NativeScript projects", | ||
@@ -16,4 +16,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"glob": "^6.0.1", | ||
"mkdirp": "^0.5.1" | ||
} | ||
} |
@@ -0,0 +0,0 @@ nativescript-hook |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19563
92
2
1
+ Addedglob@^6.0.1
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedglob@6.0.4(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)