Skip to content

Commit 9ae96e2

Browse files
committed
Fix error message
1 parent 8f0215c commit 9ae96e2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bin/commands/init.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
const fileHelpers = require("../helpers/fileHelpers"),
33
Constants = require("../helpers/constants"),
44
logger = require("../helpers/logger").winstonLogger,
5-
utils = require("../helpers/utils");
5+
utils = require("../helpers/utils"),
6+
util = require("util"),
7+
path = require('path');
68

79
module.exports = function init(args) {
810
if (args.p) {
@@ -34,7 +36,7 @@ module.exports = function init(args) {
3436
}
3537
});
3638
} else {
37-
let message = Constants.userMessages.DIR_NOT_FOUND;
39+
let message = util.format(Constants.userMessages.DIR_NOT_FOUND, path.dirname(config.path));
3840
logger.error(message);
3941
utils.sendUsageReport(null, args, message, Constants.messageTypes.ERROR, 'path_to_init_not_found');
4042
}

bin/helpers/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const userMessages = {
77
ZIP_UPLOAD_FAILED: "Zip Upload failed.",
88
CONFIG_FILE_CREATED: "BrowserStack Config File created, you can now run browserstack-cypress --config-file run",
99
CONFIG_FILE_EXISTS: "File already exists, delete the browserstack.json file manually. skipping...",
10-
DIR_NOT_FOUND: "Given path does not exist. Failed to create browserstack.json.",
10+
DIR_NOT_FOUND: "Given path does not exist. Failed to create browserstack.json in %s",
1111
ZIP_DELETE_FAILED: "Could not delete local file.",
1212
ZIP_DELETED: "Zip file deleted successfully.",
1313
API_DEPRECATED: "This version of API is deprecated, please use latest version of API.",

0 commit comments

Comments
 (0)