UNPKG

519 BPlain TextView Raw
1#!/usr/bin/env node
2
3/**
4 * Module dependencies.
5 */
6
7var spawn = require('cross-spawn')
8var resolve = require('path').resolve
9
10/**
11 * Resolve.
12 */
13
14var args = process.argv.slice(2)
15
16/**
17 * If we're not talking about a sub-command, fall back on `_metalsmith`.
18 */
19
20args.unshift(resolve(__dirname, '_metalsmith'))
21
22/**
23 * Spawn.
24 */
25
26var proc = spawn(process.execPath, args, { stdio: 'inherit' })
27
28/**
29 * Exit.
30 */
31
32proc.on('exit', function (code) {
33 // eslint-disable-next-line no-process-exit
34 process.exit(code)
35})