-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fileOrFolder execution moved to file
- Loading branch information
Showing
3 changed files
with
44 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import fs from 'fs/promises'; | ||
import chalk from 'chalk'; | ||
|
||
export default async function(config) { | ||
const { browser, fileOrFolderInputs } = fileOrFolderInputs; | ||
|
||
if (!browser) { | ||
const QUnit = (await import('./lib/setup-node-js-environment.js')).default; | ||
} | ||
|
||
fileOrFolderInputs.forEach((fileOrFolder) => { | ||
// TODO: handle/format globs | ||
|
||
try { | ||
const entry = await fs.stat(fileOrFolder); | ||
|
||
if (entry.isDirectory()) { | ||
console.log(entry, ' is directory'); | ||
} else if (entry.isFile()) { // what to do when its .ts | ||
const QUnit = (await import('./lib/setup-node-js-environment.js')).default; | ||
|
||
console.log(fileOrFolder, 'if file'); | ||
await import(`${process.cwd()}/${fileOrFolder}`); | ||
|
||
} | ||
} catch (error) { | ||
console.log(error); | ||
|
||
return process.exit(1); | ||
} | ||
}); | ||
|
||
if (!browser) { | ||
QUnit.start(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters