Skip to content

Commit

Permalink
feat: config, install, script
Browse files Browse the repository at this point in the history
  • Loading branch information
vobu committed Jun 19, 2022
1 parent 2742d30 commit d23e5bf
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const deps = [
import { gray, greenBright } from "colorette"
import { execSync } from "child_process"
import { copyFile } from "fs/promises"

const DEV_DEPS = [
"@wdio/cli",
"@wdio/local-runner",
"@wdio/mocha-framework",
Expand All @@ -8,8 +12,16 @@ const deps = [
"chromedriver"
]

export function run() {
console.log("Hello World")
// cp templates/wdio.conf.js cwd()
// npm i deps --save-dev
export async function run() {
console.log(gray("≡> copying wdio.conf.js into place..."))
await copyFile(`${__dirname}/../templates/wdio.conf.js`, `${process.cwd()}/wdio.conf.js`)
console.log(greenBright("👍 done!"))

console.log(gray("≡> installing wdio + wdi5 and adding them as dev dependencies..."))
execSync(`npm i ${DEV_DEPS.join(" ")} --save-dev`, { stdio: "inherit" })
console.log(greenBright("👍 done!"))

console.log(gray("≡> adding wdi5 start command to package.json..."))
execSync(`npm set-script wdi5 "wdio run wdio.conf.js"`, { stdio: "inherit" })
console.log(greenBright("👍 done!"))
}

0 comments on commit d23e5bf

Please sign in to comment.