diff --git a/packages/builder/cypress/setup.js b/packages/builder/cypress/setup.js index aca5ed627f..9682a07118 100644 --- a/packages/builder/cypress/setup.js +++ b/packages/builder/cypress/setup.js @@ -4,10 +4,14 @@ // 3. Runs the server using said folder const rimraf = require("rimraf") -const homedir = require("os").homedir() + "/.budibase-cypress" -const { execSync } = require("child_process") +const { join } = require("path") +const homedir = join(require("os").homedir(), ".budibase-cypress") +const init = require("../../cli/src/commands/init/initHandler") +const run = require("../../cli/src/commands/run/runHandler") rimraf.sync(homedir) -execSync(`../../packages/cli/bin/budi init -d ${homedir}`) -execSync(`../../packages/cli/bin/budi run -d ${homedir}`) +init({ dir: homedir }) +.then(() => { + run({ dir: homedir }) +}) diff --git a/packages/cli/src/commands/init/initHandler.js b/packages/cli/src/commands/init/initHandler.js index c0c4ad1b9e..3fe4134447 100644 --- a/packages/cli/src/commands/init/initHandler.js +++ b/packages/cli/src/commands/init/initHandler.js @@ -7,7 +7,7 @@ const Sqrl = require("squirrelly") const uuid = require("uuid") module.exports = opts => { - run(opts) + return run(opts) } const run = async opts => {