chore: add additional debug logging

This commit is contained in:
calebboyd
2019-10-24 09:46:08 -05:00
parent 1686c1f68c
commit e49d72db88
+10 -1
View File
@@ -31,8 +31,17 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
baseDir = path.dirname(process.execPath)
let log = (_: string) => true
let loggedManifest = false
if ((process.env.DEBUG || '').toLowerCase().includes('nexe:require')) {
log = (text: string) => process.stderr.write('[nexe] - ' + text + '\n')
log = (text: string) => {
setupManifest()
if (!loggedManifest) {
process.stderr.write('[nexe] - MANIFEST' + JSON.stringify(manifest, null, 4) + '\n')
process.stderr.write('[nexe] - DIRECTORIES' + JSON.stringify(directories, null, 4) + '\n')
loggedManifest = true
}
return process.stderr.write('[nexe] - ' + text + '\n')
}
}
const winPath = (key: string) => {