Skip to content

Commit

Permalink
Merge pull request #102 from LambdaTest/dev
Browse files Browse the repository at this point in the history
Release 2.1.9
  • Loading branch information
japneetlambdatest authored Feb 11, 2022
2 parents 4012ae5 + 73c951b commit 1e61484
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
39 changes: 21 additions & 18 deletions commands/utils/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function archive_project(lt_config) {
console.log("Ignoring files: ", ignore_files);
archive.glob(
"**/*",
{ cwd: process.cwd(), ignore: ignore_files, dot: true },
{ cwd: process.cwd(), ignore: ignore_files, dot: false },
{ prefix: "project/" }
);
//OverRide NPM Dependencies
Expand All @@ -90,12 +90,12 @@ function archive_project(lt_config) {
{ prefix: "project/" }
);
}
if (
lt_config.run_settings.dep_tokens &&
lt_config.run_settings.dep_tokens.length > 0
) {
if (fs.existsSync(".npmrc")) {
let raw_data = fs.readFileSync(".npmrc", "utf8");
if (fs.existsSync(".npmrc")) {
let raw_data = fs.readFileSync(".npmrc", "utf8");
if (
lt_config.run_settings.dep_tokens &&
lt_config.run_settings.dep_tokens.length > 0
) {
let replace_map = {};
for (let i = 0; i < lt_config.run_settings.dep_tokens.length; i++) {
if (process.env[lt_config.run_settings.dep_tokens[i]]) {
Expand All @@ -115,18 +115,21 @@ function archive_project(lt_config) {
raw_data = raw_data.replace(re, function (matched) {
return replace_map[matched];
});
archive.append(
raw_data,
{
name: "project/.npmrc",
cwd: process.cwd(),
ignore: ignore_files,
},
{ prefix: "project/" }
);
} else {
reject("Dep Tokens are passed but .npmrc does not exist");
}
archive.append(
raw_data,
{
name: "project/.npmrc",
cwd: process.cwd(),
ignore: ignore_files,
},
{ prefix: "project/" }
);
} else if (
lt_config.run_settings.dep_tokens &&
lt_config.run_settings.dep_tokens.length > 0
) {
reject("Dep Tokens are passed but .npmrc does not exist");
}

archive.finalize();
Expand Down
6 changes: 5 additions & 1 deletion commands/utils/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ module.exports = validate_config = function (lt_config) {
}
}
}
if (cypress_flag == false) {
if (cypress_flag == false && lt_config.run_settings.npm_dependencies) {
reject(
"Error!!Cypress dependency is not present in npm_dependencies"
);
} else if (cypress_flag == false) {
reject("Error!!Cypress dependency is not present in package.json");
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambdatest-cypress-cli",
"version": "2.1.8",
"version": "2.1.9",
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
"author": "LambdaTest <[email protected]>",
Expand Down

0 comments on commit 1e61484

Please sign in to comment.