-
Notifications
You must be signed in to change notification settings - Fork 0
/
babelrc.mjs
executable file
·64 lines (45 loc) · 1.08 KB
/
babelrc.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env node
import debug from 'debug'
import {
Command
} from 'commander'
import getPackage from './src/common/get-package.mjs'
import getPackageName from './src/common/get-package-name.mjs'
import getPackageVersion from './src/common/get-package-version.mjs'
import normalise from './src/common/normalise.mjs'
import B from './src/babelrc.mjs'
const {
env: {
DEBUG = 'housekeeping*'
}
} = process
if (DEBUG) debug.enable(DEBUG)
const log = debug('housekeeping')
log('`housekeeping` is awake')
const commander = new Command()
async function app () {
const PACKAGE = await getPackage()
const name = getPackageName(PACKAGE)
const {
pid,
argv,
env: {
DIR = '..',
VERSION = getPackageVersion(PACKAGE)
}
} = process
log(`Starting application "${name}" in process ${pid}.`)
commander
.version(VERSION)
.option('-d, --dir [dir]', 'Directory path')
.parse(argv)
const {
dir = DIR
} = commander.opts()
const directory = normalise(dir)
log({
directory
})
return await B(directory)
}
export default app()