1 |
ron |
1 |
'use strict';
|
|
|
2 |
|
|
|
3 |
var vscode = require('vscode');
|
|
|
4 |
|
|
|
5 |
function activate(context) {
|
|
|
6 |
|
|
|
7 |
console.log('Extension "AutoBuildMarlin" is now active!');
|
|
|
8 |
|
|
|
9 |
var NEXT_TERM_ID = 1;
|
|
|
10 |
var pio_build = vscode.commands.registerCommand('piobuild', function () {
|
|
|
11 |
const terminal = vscode.window.createTerminal(`#${NEXT_TERM_ID++}`);
|
|
|
12 |
terminal.sendText("python buildroot/share/atom/auto_build.py build");
|
|
|
13 |
});
|
|
|
14 |
var pio_clean = vscode.commands.registerCommand('pioclean', function () {
|
|
|
15 |
const terminal = vscode.window.createTerminal(`#${NEXT_TERM_ID++}`);
|
|
|
16 |
terminal.sendText("python buildroot/share/atom/auto_build.py clean");
|
|
|
17 |
});
|
|
|
18 |
var pio_upload = vscode.commands.registerCommand('pioupload', function () {
|
|
|
19 |
const terminal = vscode.window.createTerminal(`#${NEXT_TERM_ID++}`);
|
|
|
20 |
terminal.sendText("python buildroot/share/atom/auto_build.py upload");
|
|
|
21 |
});
|
|
|
22 |
var pio_traceback = vscode.commands.registerCommand('piotraceback', function () {
|
|
|
23 |
const terminal = vscode.window.createTerminal(`#${NEXT_TERM_ID++}`);
|
|
|
24 |
terminal.sendText("python buildroot/share/atom/auto_build.py traceback");
|
|
|
25 |
});
|
|
|
26 |
|
|
|
27 |
context.subscriptions.push(pio_build);
|
|
|
28 |
context.subscriptions.push(pio_clean);
|
|
|
29 |
context.subscriptions.push(pio_upload);
|
|
|
30 |
context.subscriptions.push(pio_traceback);
|
|
|
31 |
}
|
|
|
32 |
exports.activate = activate;
|
|
|
33 |
|
|
|
34 |
// this method is called when your extension is deactivated
|
|
|
35 |
function deactivate() {
|
|
|
36 |
}
|
|
|
37 |
exports.deactivate = deactivate;
|