Skip to content

Commit

Permalink
chore: added console logging for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Jan 18, 2017
1 parent 7fe27fc commit 79b0642
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions hooks/lib/android/androidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
var pathToManifest = path.join(context.opts.projectRoot, 'platforms', 'android', 'AndroidManifest.xml')
var manifest = xmlHelper.readXmlAsJson(pathToManifest)

console.log('BRANCH SDK: Updating AndroidManifest.xml')
// update manifest
manifest = removePreviousOptions(manifest)
manifest = updateBranchKeyMetaData(manifest, preferences)
Expand Down
2 changes: 1 addition & 1 deletion hooks/lib/ios/associatedDomains.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
var file = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.bundleName, 'Resources', preferences.bundleName + '.entitlements')
var entitlements = getEntitlements(file)

console.log('BRANCH SDK: Updating Associated Domains')
entitlements = updateEntitlements(entitlements, preferences)

setEntitlements(file, entitlements)
}

Expand Down
2 changes: 2 additions & 0 deletions hooks/lib/ios/developmentTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

// methods
function addDevelopmentTeam (context, preferences) {
console.log('BRANCH SDK: Updating Development Team')

if (context.opts.cordova.platforms.indexOf('ios') === -1) return
if (!context.opts.options) return
if (!context.opts.options.buildConfig) return
Expand Down
2 changes: 2 additions & 0 deletions hooks/lib/ios/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

// methods
function enableAssociatedDomains (preferences) {
console.log('BRANCH SDK: Updating Xcode preferences')

var entitlementsFile = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.bundleName, 'Resources', preferences.bundleName + '.entitlements')
var projectFile = preferences.projectPlatform.parseProjectFile(path.join(preferences.projectRoot, 'platforms', 'ios'))

Expand Down
7 changes: 4 additions & 3 deletions hooks/lib/npm/nodeDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
}

// install node modules
console.log('BRANCH SDK: Installing node dependencies')
var modules = getNodeModulesToInstall(dependencies)
installNodeModules(modules, function (err) {
if (err) {
// handle error
throw new Error('Failed to install the Branch SDK')
throw new Error('BRANCH SDK: Failed to install the Branch SDK')
} else {
// only run once
setPackageInstalled()
Expand All @@ -57,14 +58,14 @@

// install one at a time
var module = modules.pop()
console.log('Installing "' + module + '"')
console.log('BRANCH SDK: Installing "' + module + '"')

var install = 'npm install --prefix ./plugins/' + SDK + ' -D ' + module
exec(install, function (err, stdout, stderr) {
// handle error
if (err) {
callback(true)
throw new Error('Failed to install Branch Dependency: "' + module + '"')
throw new Error('BRANCH SDK: Failed to install Branch Dependency: "' + module + '"')
} else {
// next module
installNodeModules(modules, callback)
Expand Down

0 comments on commit 79b0642

Please sign in to comment.