From c9e4a6bb41e6f961464e8668935dca0db2ad5989 Mon Sep 17 00:00:00 2001 From: Joel Chen Date: Thu, 22 Mar 2018 23:50:11 -0700 Subject: [PATCH] handle windows --- xclap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xclap.js b/xclap.js index a5535d5d5..0a69342fc 100644 --- a/xclap.js +++ b/xclap.js @@ -9,6 +9,7 @@ const Path = require("path"); const yoTest = require("yeoman-test"); const _ = require("lodash"); +const isWin32 = process.platform.startsWith("win32"); const packagesDir = Path.join(__dirname, "packages"); const pullLocalPackages = dir => { @@ -53,10 +54,12 @@ const runAppTest = (dir, forceLocal) => { } }; + const fynSetup = isWin32 ? "fyn win --quiet && fynwin" : `eval "$(fyn bash)"`; + const localClap = Path.join("node_modules", ".bin", "clap"); return exec( { cwd: dir }, - `eval "$(fyn bash)" && fyn --pg simple -q v i && node_modules/.bin/clap ?fix-generator-eslint` - ).then(() => exec({ cwd: dir }, `eval "$(fyn bash)" && npm test`)); + `${fynSetup} && fyn --pg simple -q v i && ${localClap} ?fix-generator-eslint` + ).then(() => exec({ cwd: dir }, `${fynSetup} && npm test`)); }; const testGenerator = (testDir, clean, prompts) => {