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