Permalink
Browse files

feat(log): add stderr logging

  • Loading branch information...
zkat committed Dec 4, 2017
1 parent 361dec7 commit 184d6ec8f9f3b96bf1e95e2de4c99aba878b5aed
Showing with 13 additions and 0 deletions.
  1. +13 −0 index.js
@@ -111,6 +111,14 @@ function install (argv) {
argv.files.map(f => `${f} merge=${argv.driverName}`).join('\n') +
'\n'
)
console.error(
'npm-merge-driver:',
argv.driverName,
'installed to `git config',
opts + '`',
'and',
attrFile
)
}
function uninstall (argv) {
@@ -169,6 +177,7 @@ function findAttributes (argv) {
}
function merge (argv) {
console.error('npm-merge-driver: merging', argv['%P'])
const ret = cp.spawnSync(
'git',
['merge-file', '-p', argv['%A'], argv['%O'], argv['%B']],
@@ -187,10 +196,14 @@ function merge (argv) {
throw e
}
fs.writeFileSync(argv['%P'], fs.readFileSync(argv['%B']))
console.error(
'npm-merge-driver: --legacy enabled. Checking out --theirs and retrying merge'
)
cp.execSync(argv.command, {
stdio: 'inherit',
cwd: path.dirname(argv['%P'])
})
}
fs.writeFileSync(argv['%A'], fs.readFileSync(argv['%P']))
console.error('npm-merge-driver:', argv['%P'], 'successfully merged.')
}

0 comments on commit 184d6ec

Please sign in to comment.