git-wt-watch
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -90,3 +90,3 @@ #!/usr/bin/env node | ||
var compileCommands = {}; | ||
var allCompileCommands = {}; | ||
const fullConfig = await config.getConfig('compilecheck'); | ||
@@ -99,5 +99,5 @@ dlog(fullConfig); | ||
{ | ||
compileCommands = await loadMultipleCompileCommands({builddirs}); | ||
const files = _.keys(compileCommands); | ||
dlog("The first compileCommandObj:", compileCommands[_.first(files)]); | ||
allCompileCommands = await loadMultipleCompileCommands({builddirs}); | ||
const files = _.keys(allCompileCommands); | ||
dlog("The first compileCommandObj:", allCompileCommands[_.first(files)]); | ||
dlog(`Got compile commands of length ${files.length}`); | ||
@@ -130,3 +130,3 @@ } | ||
console.log('Changed files to compile:', files); | ||
const compileCommandObjs = _(files).map(file => findCompileCommandObject(file)).compact().value(); | ||
const compileCommandObjs = _(files).map(file => findCompileCommandObject({file, allCompileCommands})).compact().value(); | ||
dlog(compileCommandObjs); | ||
@@ -133,0 +133,0 @@ return executeMultipleCompileCommands(compileCommandObjs) |
@@ -57,6 +57,8 @@ // compile.js | ||
function findCompileCommandObject(file, compileCommandObjs) | ||
function findCompileCommandObject({file, allCompileCommands}) | ||
{ | ||
if (file in compileCommandObjs) { | ||
return compileCommandObjs[file]; // file is a .cpp file | ||
expect(allCompileCommands).to.exist; | ||
if (file in allCompileCommands) { | ||
dlog(`findCompileCommandObject found compile command for .cpp file: ${file}`); | ||
return allCompileCommands[file]; // file is a .cpp file | ||
} else { | ||
@@ -68,8 +70,10 @@ const re = /^([.\w]+)(\-\w\w\w)\.hpp$/; | ||
const proxy = m[1] + '.cpp'; | ||
if (proxy in compileCommandObjs) { | ||
dlog("Using proxy source file:", proxy); | ||
return compileCommandObjs[proxy]; | ||
dlog(`trying proxy ${file} -> ${proxy}`); | ||
if (proxy in allCompileCommands) { | ||
dlog("findCompileCommandObject using proxy source file:", proxy); | ||
return allCompileCommands[proxy]; | ||
} | ||
} | ||
} | ||
dlog(`findCompileCommandObject failed to find compile command for: ${file}`); | ||
return null; | ||
@@ -76,0 +80,0 @@ } |
{ | ||
"name": "git-wt-watch", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Keep two git working trees synchronized", | ||
@@ -5,0 +5,0 @@ "main": "client.js", |
20319
551