Skip to content

Commit 9c2b2f4

Browse files
Roshan NikamRoshan Nikam
authored andcommitted
increasing width for fetching raw logs under various commands
1 parent 5d56d51 commit 9c2b2f4

File tree

6 files changed

+24
-19
lines changed

6 files changed

+24
-19
lines changed

bin/commands/generateDownloads.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const logger = require("../helpers/logger").winstonLogger,
66
downloadBuildArtifacts = require('../helpers/buildArtifacts').downloadBuildArtifacts;
77

88

9-
module.exports = async function generateDownloads(args) {
9+
module.exports = async function generateDownloads(args, rawArgs) {
1010
let bsConfigPath = utils.getConfigPath(args.cf);
1111

1212
return utils.validateBstackJson(bsConfigPath).then(async function (bsConfig) {
@@ -29,11 +29,11 @@ module.exports = async function generateDownloads(args) {
2929
let buildId = args._[1];
3030

3131
await downloadBuildArtifacts(bsConfig, buildId, args);
32-
utils.sendUsageReport(bsConfig, args, Constants.usageReportingConstants.GENERATE_DOWNLOADS, messageType, errorCode);
32+
utils.sendUsageReport(bsConfig, args, Constants.usageReportingConstants.GENERATE_DOWNLOADS, messageType, errorCode, null, rawArgs);
3333
}).catch(function (err) {
3434
logger.error(err);
3535
utils.setUsageReportingFlag(null, args.disableUsageReporting);
36-
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err));
36+
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs);
3737
process.exitCode = Constants.ERROR_EXIT_CODE;
3838
});
3939
};

bin/commands/generateReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const logger = require("../helpers/logger").winstonLogger,
66
reporterHTML = require('../helpers/reporterHTML');
77

88

9-
module.exports = function generateReport(args) {
9+
module.exports = function generateReport(args, rawArgs) {
1010
let bsConfigPath = utils.getConfigPath(args.cf);
1111
let reportGenerator = reporterHTML.reportGenerator;
1212

@@ -30,11 +30,11 @@ module.exports = function generateReport(args) {
3030
let buildId = args._[1];
3131

3232
reportGenerator(bsConfig, buildId, args);
33-
utils.sendUsageReport(bsConfig, args, 'generate-report called', messageType, errorCode);
33+
utils.sendUsageReport(bsConfig, args, 'generate-report called', messageType, errorCode, null, rawArgs);
3434
}).catch(function (err) {
3535
logger.error(err);
3636
utils.setUsageReportingFlag(null, args.disableUsageReporting);
37-
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err));
37+
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs);
3838
process.exitCode = Constants.ERROR_EXIT_CODE;
3939
});
4040
};

bin/commands/info.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const config = require("../helpers/config"),
66
Constants = require("../helpers/constants"),
77
utils = require("../helpers/utils");
88

9-
module.exports = function info(args) {
9+
module.exports = function info(args, rawArgs) {
1010
let bsConfigPath = utils.getConfigPath(args.cf);
1111

1212
return utils.validateBstackJson(bsConfigPath).then(function (bsConfig) {
@@ -90,12 +90,12 @@ module.exports = function info(args) {
9090
logger.info(message);
9191
}
9292
}
93-
utils.sendUsageReport(bsConfig, args, message, messageType, errorCode);
93+
utils.sendUsageReport(bsConfig, args, message, messageType, errorCode, null, rawArgs);
9494
});
9595
}).catch(function (err) {
9696
logger.error(err);
9797
utils.setUsageReportingFlag(null, args.disableUsageReporting);
98-
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err));
98+
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs);
9999
process.exitCode = Constants.ERROR_EXIT_CODE;
100100
})
101101
}

bin/commands/init.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function get_path(args) {
3535
}
3636

3737

38-
module.exports = function init(args) {
38+
module.exports = function init(args, rawArgs) {
3939

4040
let path_to_json = get_path(args);
4141
if (path_to_json === undefined) return;
@@ -57,15 +57,15 @@ module.exports = function init(args) {
5757
if (exists) {
5858
let message = Constants.userMessages.CONFIG_FILE_EXISTS;
5959
logger.error(message);
60-
utils.sendUsageReport(null, args, message, Constants.messageTypes.ERROR, 'bstack_json_already_exists');
60+
utils.sendUsageReport(null, args, message, Constants.messageTypes.ERROR, 'bstack_json_already_exists', null, rawArgs);
6161
} else {
6262
fileHelpers.write(config, null, args, utils.configCreated);
6363
}
6464
});
6565
} else {
6666
let message = util.format(Constants.userMessages.DIR_NOT_FOUND, path.dirname(config.path));
6767
logger.error(message);
68-
utils.sendUsageReport(null, args, message, Constants.messageTypes.ERROR, 'path_to_init_not_found');
68+
utils.sendUsageReport(null, args, message, Constants.messageTypes.ERROR, 'path_to_init_not_found', null, rawArgs);
6969
}
7070
});
7171
}

bin/commands/stop.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const config = require("../helpers/config"),
66
Constants = require("../helpers/constants"),
77
utils = require("../helpers/utils");
88

9-
module.exports = function stop(args) {
9+
module.exports = function stop(args, rawArgs) {
1010
let bsConfigPath = utils.getConfigPath(args.cf);
1111

1212
return utils.validateBstackJson(bsConfigPath).then(async function (bsConfig) {
@@ -30,7 +30,7 @@ module.exports = function stop(args) {
3030
}).catch(function (err) {
3131
logger.error(err);
3232
utils.setUsageReportingFlag(null, args.disableUsageReporting);
33-
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err));
33+
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs);
3434
process.exitCode = Constants.ERROR_EXIT_CODE;
3535
})
3636
}

bin/runner.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var argv = yargs
6767
.showHelpOnFail(false, Constants.cliMessages.VERSION.HELP)
6868
.demand(1, Constants.cliMessages.VERSION.DEMAND)
6969
.command('init', Constants.cliMessages.INIT.INFO, function(yargs) {
70+
let rawArgv = yargs.argv;
7071
argv = yargs
7172
.usage("usage: $0 init [filename] [options]")
7273
.options({
@@ -82,10 +83,11 @@ var argv = yargs
8283
.wrap(null).argv;
8384

8485
if (checkCommands(yargs, argv, 1)) {
85-
return require('./commands/init')(argv);
86+
return require('./commands/init')(argv, rawArgv);
8687
}
8788
})
8889
.command('build-info', Constants.cliMessages.BUILD.INFO, function(yargs) {
90+
let rawArgv = yargs.argv;
8991
argv = yargs
9092
.usage('usage: $0 <buildId>')
9193
.demand(1, Constants.cliMessages.BUILD.DEMAND)
@@ -97,10 +99,11 @@ var argv = yargs
9799
.argv
98100
if (checkCommands(yargs, argv, 1)) {
99101
logger.info(Constants.cliMessages.BUILD.INFO_MESSAGE + argv._[1]);
100-
return require('./commands/info')(argv);
102+
return require('./commands/info')(argv, rawArgv);
101103
}
102104
})
103105
.command('build-stop', Constants.cliMessages.BUILD.STOP, function (yargs) {
106+
let rawArgv = yargs.argv;
104107
argv = yargs
105108
.usage('usage: $0 <buildId>')
106109
.demand(1, Constants.cliMessages.BUILD.DEMAND)
@@ -112,7 +115,7 @@ var argv = yargs
112115
.argv
113116
if (checkCommands(yargs, argv, 1)) {
114117
logger.info(Constants.cliMessages.BUILD.STOP_MESSAGE + argv._[1]);
115-
return require('./commands/stop')(argv);
118+
return require('./commands/stop')(argv, rawArgv);
116119
}
117120
})
118121
.command('run', Constants.cliMessages.RUN.INFO, function(yargs) {
@@ -237,6 +240,7 @@ var argv = yargs
237240
}
238241
})
239242
.command('generate-report', Constants.cliMessages.GENERATE_REPORT.INFO, function(yargs) {
243+
let rawArgv = yargs.argv;
240244
argv = yargs
241245
.usage('usage: $0 generate-report <buildId>')
242246
.demand(1, Constants.cliMessages.BUILD.DEMAND)
@@ -248,10 +252,11 @@ var argv = yargs
248252
.argv
249253
if (checkCommands(yargs, argv, 1)) {
250254
logger.info(Constants.cliMessages.BUILD.INFO_MESSAGE + argv._[1]);
251-
return require('./commands/generateReport')(argv);
255+
return require('./commands/generateReport')(argv, rawArgv);
252256
}
253257
})
254258
.command('generate-downloads', Constants.cliMessages.GENERATE_DOWNLOADS.INFO, function(yargs) {
259+
let rawArgv = yargs.argv;
255260
argv = yargs
256261
.usage('usage: $0 generate-downloads <buildId>')
257262
.demand(1, Constants.cliMessages.BUILD.DEMAND)
@@ -263,7 +268,7 @@ var argv = yargs
263268
.argv
264269
if (checkCommands(yargs, argv, 1)) {
265270
logger.info(Constants.cliMessages.BUILD.INFO_MESSAGE + argv._[1]);
266-
return require('./commands/generateDownloads')(argv);
271+
return require('./commands/generateDownloads')(argv, rawArgv);
267272
}
268273
})
269274
.help('help')

0 commit comments

Comments
 (0)