apify-cli 0.16.2-beta.4 → 0.16.2-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,6 +54,7 @@
54
54
  "@oclif/test": "^2.1.0",
55
55
  "chai": "^4.3.4",
56
56
  "chai-match": "^1.1.1",
57
+ "cross-env": "^7.0.3",
57
58
  "eslint": "^8.11.0",
58
59
  "mocha": "^10.0.0",
59
60
  "sinon": "^9.2.4"
@@ -2113,6 +2114,24 @@
2113
2114
  "node": ">= 0.10.0"
2114
2115
  }
2115
2116
  },
2117
+ "node_modules/cross-env": {
2118
+ "version": "7.0.3",
2119
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
2120
+ "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
2121
+ "dev": true,
2122
+ "dependencies": {
2123
+ "cross-spawn": "^7.0.1"
2124
+ },
2125
+ "bin": {
2126
+ "cross-env": "src/bin/cross-env.js",
2127
+ "cross-env-shell": "src/bin/cross-env-shell.js"
2128
+ },
2129
+ "engines": {
2130
+ "node": ">=10.14",
2131
+ "npm": ">=6",
2132
+ "yarn": ">=1"
2133
+ }
2134
+ },
2116
2135
  "node_modules/cross-spawn": {
2117
2136
  "version": "7.0.3",
2118
2137
  "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -9510,6 +9529,15 @@
9510
9529
  "readable-stream": "^2.0.0"
9511
9530
  }
9512
9531
  },
9532
+ "cross-env": {
9533
+ "version": "7.0.3",
9534
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
9535
+ "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
9536
+ "dev": true,
9537
+ "requires": {
9538
+ "cross-spawn": "^7.0.1"
9539
+ }
9540
+ },
9513
9541
  "cross-spawn": {
9514
9542
  "version": "7.0.3",
9515
9543
  "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "apify-cli",
3
- "version": "0.16.2-beta.4",
3
+ "version": "0.16.2-beta.6",
4
4
  "description": "Apify command-line interface helps you create, develop, build and run Apify actors, and manage the Apify cloud platform.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "mocha --timeout 180000 --recursive",
8
- "test-python": "mocha --timeout 180000 --recursive --grep '\\[python\\]'",
7
+ "test": "cross-env APIFY_CLI_SKIP_UPDATE_CHECK=1 mocha --timeout 180000 --recursive",
8
+ "test-python": "npm run test -- --grep '\\[python\\]'",
9
9
  "lint": "eslint src test",
10
10
  "lint:fix": "eslint src test --fix",
11
11
  "commands-md": "npm run manifest && oclif-dev readme",
@@ -94,6 +94,7 @@
94
94
  "@oclif/test": "^2.1.0",
95
95
  "chai": "^4.3.4",
96
96
  "chai-match": "^1.1.1",
97
+ "cross-env": "^7.0.3",
97
98
  "eslint": "^8.11.0",
98
99
  "mocha": "^10.0.0",
99
100
  "sinon": "^9.2.4"
package/src/hooks/init.js CHANGED
@@ -1,4 +1,4 @@
1
- const { checkLatestVersion } = require('../lib/version_check');
1
+ const { checkLatestVersion, SKIP_UPDATE_CHECK } = require('../lib/version_check');
2
2
 
3
3
  /**
4
4
  * This code'll be call before each commmand run
@@ -8,6 +8,9 @@ exports.default = async (params) => {
8
8
  // This is not nessesary when you call the `--check-version` as the same command is called there.
9
9
  if (['cv', 'check-version'].includes(params.id)) return;
10
10
 
11
+ // If the user has configured the `APIFY_CLI_SKIP_UPDATE_CHECK` env variable then skip the check.
12
+ if (SKIP_UPDATE_CHECK) return;
13
+
11
14
  // Check package latest version
12
15
  await checkLatestVersion();
13
16
  };
@@ -25,6 +25,11 @@ const UPDATE_COMMAND = {
25
25
  [INSTALLATION_TYPE.NPM]: 'npm install -g apify-cli@latest',
26
26
  };
27
27
 
28
+ const SKIP_UPDATE_CHECK = (
29
+ process.env.APIFY_CLI_SKIP_UPDATE_CHECK
30
+ && !['0', 'false'].includes(process.env.APIFY_CLI_SKIP_UPDATE_CHECK.toLowerCase())
31
+ );
32
+
28
33
  /**
29
34
  * Detect through which package manager the Apify CLI was installed.
30
35
  * @returns {INSTALLATION_TYPE} The installation type of the CLI.
@@ -115,4 +120,5 @@ const checkLatestVersion = async (enforeUpdate = false) => {
115
120
  module.exports = {
116
121
  checkLatestVersion,
117
122
  getLatestNpmVersion,
123
+ SKIP_UPDATE_CHECK,
118
124
  };