create-wdio 8.3.2 → 8.3.3

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 +12 -5
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -52,13 +52,20 @@ export async function createWebdriverIO(opts) {
52
52
  type: 'module'
53
53
  }, null, 2));
54
54
  /**
55
- * create a package-lock.json so that `detect-package-manager`
56
- * doesn't mark it as a Yarn project
55
+ * find package manager that was used to create project
56
+ */
57
+ const pm = PMs.find((pm) => (
58
+ // for pnpm check for "~/Library/pnpm/store/v3/..."
59
+ process.argv[0].includes(`${path.sep}${pm}${path.sep}`) ||
60
+ // for NPM and Yarn check for "~/.npm/npx/..." or "~/.yarn/bin/create-wdio"
61
+ process.argv[0].includes(`${path.sep}.${pm}${path.sep}`))) || 'npm';
62
+ /**
63
+ * create a package-lock.json, yarn.lock or pnpm-lock.yaml so
64
+ * that `detect-package-manager` doesn't mark it as a default
65
+ * Yarn project
57
66
  * @see https://github.com/egoist/detect-package-manager/issues/11
58
67
  */
59
- console.log(process.argv);
60
- const cmd = PMs.includes(process.argv0) ? process.argv0 : 'npm';
61
- await runProgram(cmd, ['install'], { cwd: root, stdio: 'ignore' });
68
+ await runProgram(pm, ['install'], { cwd: root, stdio: 'ignore' });
62
69
  }
63
70
  console.log(`\nInstalling ${chalk.bold('@wdio/cli')} to initialize project...`);
64
71
  const pm = await detect({ cwd: root });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wdio",
3
- "version": "8.3.2",
3
+ "version": "8.3.3",
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",