create-wdio 8.3.1 → 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.
- package/build/index.js +12 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -52,12 +52,20 @@ export async function createWebdriverIO(opts) {
|
|
|
52
52
|
type: 'module'
|
|
53
53
|
}, null, 2));
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
|
|
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
|
-
|
|
60
|
-
await runProgram(cmd, ['install'], { cwd: root, stdio: 'ignore' });
|
|
68
|
+
await runProgram(pm, ['install'], { cwd: root, stdio: 'ignore' });
|
|
61
69
|
}
|
|
62
70
|
console.log(`\nInstalling ${chalk.bold('@wdio/cli')} to initialize project...`);
|
|
63
71
|
const pm = await detect({ cwd: root });
|
package/package.json
CHANGED