MCPcopy
hub / github.com/brunch/brunch / create

Function create

lib/index.js:7–30  ·  view source on GitHub ↗

* Initialize new brunch project. * @param {Object} options - skeleton like 'simple', path like '.'

(options = {})

Source from the content-addressed store, hash-verified

5 * @param {Object} options - skeleton like 'simple', path like '.'
6 */
7async function create(options = {}) {
8 const {initSkeleton} = require('./init-skeleton');
9 const BrunchError = require('./utils/error');
10 const loggy = require('loggy');
11
12 // Check for legacy syntax
13 if (options.parent) {
14 const rawArgs = options.parent.rawArgs;
15 const newArgs = rawArgs.slice(rawArgs.indexOf('new') + 1);
16 const oldSyntax = !options.skeleton && newArgs.length === 2;
17 if (oldSyntax) {
18 throw new BrunchError('LEGACY_NEW_SYNTAX', {
19 skeleton: newArgs[0],
20 path: newArgs[1],
21 });
22 }
23 }
24
25 try {
26 return await initSkeleton(options.skeleton, options.path);
27 } catch (error) {
28 loggy.error(error);
29 }
30};
31
32function build(options) {
33 const hasDebug = obj => {

Callers

nothing calls this directly

Calls 2

initSkeletonFunction · 0.85
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…