-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (27 loc) · 847 Bytes
/
index.js
File metadata and controls
34 lines (27 loc) · 847 Bytes
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
const fs = require('fs')
const path = require('path')
const symdeps = require('./lib/symdeps')
module.exports = () => {
const package_file = fs.readFileSync(path.resolve('package.json'), 'utf8')
if (!package_file) {
console.log('symdeps:', 'No package.json found at current working directory.')
return
}
try {
var package_json = JSON.parse(package_file)
}
catch (error) {
// If package.json cannot be parsed, something’s terribly wrong.
console.error(error)
process.exit(1)
return
}
const config = package_json.symdeps
if (!config || !config.paths) {
console.log('symdeps:', 'No symdeps directives found.')
return
}
config.hard = config.hard || process.argv.indexOf('--hard') > -1
config.absolute = config.absolute || process.argv.indexOf('--absolute') > -1
symdeps(config)
}