Merge pull request #1785 from balena-io/add-debug-flag

Add support for global --debug flag
This commit is contained in:
srlowe 2020-04-30 06:34:15 +02:00 committed by GitHub
commit 9ab34c2deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,6 +52,13 @@ export async function routeCliFramework(argv: string[], options: AppOptions) {
cmdSlice.shift();
cmdSlice.push('--help');
}
// support global --debug flag
const debugIndex = cmdSlice.indexOf('--debug');
if (debugIndex > -1) {
process.env.DEBUG = '1';
cmdSlice.splice(debugIndex, 1);
}
}
const [isOclif, isTopic] = isOclifCommand(cmdSlice);