Skip to content

Commit 2392a74

Browse files
Improved CLI experience
1 parent a81ed43 commit 2392a74

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

bin/commands/runs.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const archiver = require("../helpers/archiver"),
1212
checkUploaded = require("../helpers/checkUploaded"),
1313
reportGenerator = require('../helpers/reporterHTML').reportGenerator,
1414
{initTimeComponents, instrumentEventTime, markBlockStart, markBlockEnd, getTimeComponents} = require('../helpers/timeComponents'),
15-
downloadBuildArtifacts = require('../helpers/buildArtifacts').downloadBuildArtifacts;
15+
downloadBuildArtifacts = require('../helpers/buildArtifacts').downloadBuildArtifacts,
16+
updateNotifier = require('update-notifier'),
17+
pkg = require('../../package.json');
1618

1719
module.exports = function run(args) {
1820
let bsConfigPath = utils.getConfigPath(args.cf);
@@ -235,5 +237,10 @@ module.exports = function run(args) {
235237
logger.error(err);
236238
utils.setUsageReportingFlag(null, args.disableUsageReporting);
237239
utils.sendUsageReport(null, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err));
240+
}).finally(function(){
241+
updateNotifier({
242+
pkg,
243+
updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
244+
}).notify();
238245
});
239246
}

bin/helpers/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const syncCLI = {
77
},
88
INITIAL_DELAY_MULTIPLIER: 10,
99
DEFAULT_LINE_SEP: "\n--------------------------------------------------------------------------------",
10+
STARTUP_MESSAGE: "BrowserStack machines are now setting up Cypress with the specified npm dependencies for running your tests. It might take some time before your tests start runnning and showing up below..."
1011
};
1112

1213
const userMessages = {
@@ -143,7 +144,7 @@ const messageTypes = {
143144
NULL: null
144145
}
145146

146-
const allowedFileTypes = ['js', 'json', 'txt', 'ts', 'feature', 'features', 'pdf', 'jpg', 'jpeg', 'png', 'zip', 'npmrc', 'xml', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'jsx', 'coffee', 'cjsx', 'csv', 'tsv', 'yml', 'yaml', 'env'];
147+
const allowedFileTypes = ['js', 'json', 'txt', 'ts', 'feature', 'features', 'pdf', 'jpg', 'jpeg', 'png', 'zip', 'npmrc', 'xml', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'jsx', 'coffee', 'cjsx', 'csv', 'tsv', 'yml', 'yaml', 'env', 'mov', 'mp4'];
147148

148149
const filesToIgnoreWhileUploading = [
149150
'**/node_modules/**',

bin/helpers/sync/syncSpecsLogs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const request = require("request"),
33
config = require("../config"),
44
utils = require("../utils"),
55
logger = require("../logger").syncCliLogger,
6+
winstonLogger = require("../logger").winstonLogger,
67
async = require('async'),
78
Constants = require("../constants"),
89
tableStream = require('table').createStream,
@@ -164,6 +165,7 @@ let showSpecsStatus = (data) => {
164165
}
165166

166167
let printInitialLog = () => {
168+
winstonLogger.info(Constants.syncCLI.STARTUP_MESSAGE);
167169
logger.info(`\n${Constants.syncCLI.LOGS.INIT_LOG}`)
168170
logger.info(lineSeparator);
169171
n = Constants.syncCLI.INITIAL_DELAY_MULTIPLIER

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"winston": "^2.3.1",
2828
"yargs": "^14.2.3",
2929
"axios": "^0.21.1",
30-
"unzipper": "^0.10.11"
30+
"unzipper": "^0.10.11",
31+
"update-notifier": "^5.1.0"
3132
},
3233
"repository": {
3334
"type": "git",

0 commit comments

Comments
 (0)