diff --git a/commands/utils/archive.js b/commands/utils/archive.js index 5e13f27..602a63f 100644 --- a/commands/utils/archive.js +++ b/commands/utils/archive.js @@ -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 @@ -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]]) { @@ -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(); diff --git a/commands/utils/validate.js b/commands/utils/validate.js index c5f46b4..51bfb0a 100644 --- a/commands/utils/validate.js +++ b/commands/utils/validate.js @@ -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) { diff --git a/package.json b/package.json index cddc7f1..54e6a44 100644 --- a/package.json +++ b/package.json @@ -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 ",