diff --git a/hooks/beforePluginInstallHook.js b/hooks/beforePluginInstallHook.js index c4385df9..e863eb48 100644 --- a/hooks/beforePluginInstallHook.js +++ b/hooks/beforePluginInstallHook.js @@ -37,7 +37,7 @@ function createPluginInstalledFlag(ctx) { } // endregion -module.exports = function(ctx) { +module.exports = function (ctx) { if (isInstallationAlreadyPerformed(ctx)) { return; } @@ -46,7 +46,9 @@ module.exports = function(ctx) { console.log(JSON.stringify(pluginNpmDependencies, null, 2)); var npm = (process.platform === "win32" ? "npm.cmd" : "npm"); - var result = spawnSync(npm, ['install', '--production'], { cwd: './plugins/' + ctx.opts.plugin.id }); + + var pluginPath = path.join(ctx.opts.projectRoot, 'plugins', ctx.opts.plugin.id); + var result = spawnSync(npm, ['install', '--production'], { cwd: pluginPath, shell: true }); if (result.error) { throw result.error; } diff --git a/hooks/lib/ios/projectEntitlements.js b/hooks/lib/ios/projectEntitlements.js index 6d3f6160..03637da6 100644 --- a/hooks/lib/ios/projectEntitlements.js +++ b/hooks/lib/ios/projectEntitlements.js @@ -139,7 +139,12 @@ function domainsListEntryForHost(host) { * @return {String} absolute path to entitlements file */ function pathToEntitlementsFile() { - return path.join(getProjectRoot(), 'platforms/ios/', getProjectName()); + const projectRoot = context.opts.projectRoot; + const platformPath = path.join(projectRoot, 'platforms', 'ios'); + const cordova_ios = require('cordova-ios'); + const iosProject = new cordova_ios('ios', platformPath); + const infoPlistPath = path.join(iosProject.locations.xcodeCordovaProj); + return infoPlistPath; } /** diff --git a/package.json b/package.json index 99c3c017..692c6976 100644 --- a/package.json +++ b/package.json @@ -26,15 +26,14 @@ "android" ], "dependencies": { - "mkpath": ">=1.0.0", - "xml2js": ">=0.4", - "rimraf": ">=2.4", - "node-version-compare": ">=1.0.1", - "plist": ">=1.2.0" + "mkpath": "^1.0.0", + "plist": "^3.1.0", + "rimraf": "^6.1.2", + "xml2js": "^0.6.2" }, "author": "Nikolay Demyankov for Nordnet Bank AB", "license": "MIT", "bugs": { "url": "https://github.com/gedysintraware/cordova-universal-links-plugin/issues" } -} +} \ No newline at end of file