-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.js
More file actions
20 lines (16 loc) · 789 Bytes
/
build.js
File metadata and controls
20 lines (16 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Super-simple wrapper around the `arduino-builder` CLI tool
// setting up the neccesary paths
var path = require('path');
var sketch = process.argv[2] || 'build/main/main.ino';
var board = process.argv[3] || 'arduino:avr:uno';
var arduinoDir = process.env.ARDUINO || process.env.HOME + "/arduino-1.8.1";
var buildDir = path.join(path.dirname(sketch), 'builder');
var builder = path.join(arduinoDir, 'arduino-builder');
var cmd = builder + ' -compile ' + ' -verbose' +
" -hardware " + path.join(arduinoDir, 'hardware') +
' -tools ' + path.join(arduinoDir, 'tools-builder') +
' -tools ' + path.join(arduinoDir, 'hardware', 'tools') +
' -libraries ' + path.join(process.env.HOME, 'Arduino', 'libraries') +
' -fqbn ' + board +
' ' + sketch;
console.log(cmd);