PCB progress
This commit is contained in:
parent
a6ed52b4bd
commit
05a33d00ec
7 changed files with 367 additions and 12 deletions
10
src/cli.js
10
src/cli.js
|
@ -36,8 +36,14 @@ const args = yargs
|
|||
describe: 'Debug mode',
|
||||
type: 'boolean'
|
||||
})
|
||||
.option('clean', {
|
||||
default: false,
|
||||
describe: 'Clean output dir before parsing',
|
||||
type: 'boolean'
|
||||
})
|
||||
.argv
|
||||
|
||||
if (args.clean) fs.removeSync(args.o)
|
||||
fs.mkdirpSync(args.o)
|
||||
|
||||
const config_parser = args.c.endsWith('.yaml') ? yaml.load : JSON.parse
|
||||
|
@ -72,7 +78,9 @@ for (const [name, outline] of Object.entries(outlines)) {
|
|||
|
||||
console.log('Scaffolding PCB...')
|
||||
const pcb = pcb_lib.parse(config.pcb, points, outlines)
|
||||
fs.writeFileSync(path.join(args.o, `pcb/pcb.kicad_pcb`, pcb))
|
||||
const pcb_file = path.join(args.o, `pcb/pcb.kicad_pcb`)
|
||||
fs.mkdirpSync(path.dirname(pcb_file))
|
||||
fs.writeFileSync(pcb_file, pcb)
|
||||
|
||||
// goodbye
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue