create-wdio 8.4.4 → 8.4.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.
Files changed (2) hide show
  1. package/build/index.js +13 -4
  2. package/package.json +14 -14
package/build/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { pathToFileURL } from 'node:url';
4
+ import { execSync } from 'node:child_process';
4
5
  import chalk from 'chalk';
5
6
  import semver from 'semver';
6
7
  import { Command } from 'commander';
7
8
  import { resolve } from 'import-meta-resolve';
8
9
  import { runProgram, getPackageVersion } from './utils.js';
9
10
  import { ASCII_ROBOT, PROGRAM_TITLE, UNSUPPORTED_NODE_VERSION, DEFAULT_NPM_TAG, INSTALL_COMMAND, DEV_FLAG, PMs, EXECUTER, EXECUTE_COMMAND } from './constants.js';
10
- import { execSync } from 'node:child_process';
11
11
  const WDIO_COMMAND = 'wdio';
12
12
  let projectDir;
13
13
  export async function run(operation = createWebdriverIO) {
@@ -87,9 +87,18 @@ async function isCLIInstalled(path) {
87
87
  }
88
88
  catch (error) {
89
89
  // check of the cli is installed globally
90
- const output = execSync('npm ls -g', { encoding: 'utf-8' });
91
- if (output.includes('@wdio/cli')) {
92
- return true;
90
+ // wrap in try/catch as it can fail on Windows
91
+ try {
92
+ const output = execSync('npm ls -g', {
93
+ encoding: 'utf-8',
94
+ stdio: ['ignore', 'pipe', 'ignore']
95
+ });
96
+ if (output.includes('@wdio/cli')) {
97
+ return true;
98
+ }
99
+ }
100
+ catch (err) {
101
+ return false;
93
102
  }
94
103
  return false;
95
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wdio",
3
- "version": "8.4.4",
3
+ "version": "8.4.6",
4
4
  "description": "Install and setup a WebdriverIO project with all its dependencies in a single run",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "license": "MIT",
@@ -38,23 +38,23 @@
38
38
  "watch": "npm run compile -- --watch"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/cross-spawn": "^6.0.2",
42
- "@types/node": "^20.4.2",
43
- "@types/semver": "^7.5.0",
44
- "@typescript-eslint/eslint-plugin": "^6.0.0",
45
- "@typescript-eslint/parser": "^6.0.0",
46
- "@vitest/coverage-v8": "^1.0.4",
47
- "eslint": "^8.45.0",
48
- "eslint-plugin-import": "^2.27.5",
49
- "eslint-plugin-unicorn": "^49.0.0",
41
+ "@types/cross-spawn": "^6.0.6",
42
+ "@types/node": "^20.10.5",
43
+ "@types/semver": "^7.5.6",
44
+ "@typescript-eslint/eslint-plugin": "^6.16.0",
45
+ "@typescript-eslint/parser": "^6.16.0",
46
+ "@vitest/coverage-v8": "^1.1.0",
47
+ "eslint": "^8.56.0",
48
+ "eslint-plugin-import": "^2.29.1",
49
+ "eslint-plugin-unicorn": "^50.0.1",
50
50
  "npm-run-all": "^4.1.5",
51
- "release-it": "^17.0.0",
52
- "typescript": "^5.1.6",
53
- "vitest": "^1.0.4"
51
+ "release-it": "^17.0.1",
52
+ "typescript": "^5.3.3",
53
+ "vitest": "^1.1.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "chalk": "^5.3.0",
57
- "commander": "^11.0.0",
57
+ "commander": "^11.1.0",
58
58
  "cross-spawn": "^7.0.3",
59
59
  "import-meta-resolve": "^4.0.0",
60
60
  "semver": "^7.5.4"