Skip to content

Commit 58e2495

Browse files
committed
Improve board naming after switch
Signed-off-by: paulober <[email protected]>
1 parent 8c240de commit 58e2495

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- name: Install Dependencies
2222
run: |
2323
npm install -g npm
24+
npm -v
2425
npm i -g @vscode/vsce ovsx
2526
npm ci
2627
- name: Lint Extension

.github/workflows/static.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- name: Install Dependencies
4444
run: |
4545
npm install -g npm
46+
npm -v
4647
npm ci
4748
pip install requests js2py
4849
- name: Generate Cache JSON

src/commands/switchBoard.mts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import State from "../state.mjs";
3131
import { unknownErrorToString } from "../utils/errorHelper.mjs";
3232
import { SWITCH_BOARD } from "./cmdIds.mjs";
3333
import { zephyrTouchTasksJson } from "../utils/setupZephyr.mjs";
34+
import {
35+
ZEPHYR_PICO,
36+
ZEPHYR_PICO2,
37+
ZEPHYR_PICO2_W,
38+
ZEPHYR_PICO_W,
39+
} from "../models/zephyrBoards.mjs";
3440

3541
interface IBoardFile {
3642
[key: string]: string;
@@ -261,7 +267,21 @@ export default class SwitchBoardCommand extends Command {
261267
const board = stringToZephyrBoard(boardRes[0]);
262268
const taskJsonFile = Uri.joinPath(wsf.uri, ".vscode", "tasks.json");
263269
await zephyrTouchTasksJson(taskJsonFile, board);
264-
this._ui.updateBoard(board);
270+
271+
// TODO: duplicate code with extension move into helper
272+
if (board !== undefined) {
273+
if (board === ZEPHYR_PICO2_W) {
274+
this._ui.updateBoard("Pico 2W");
275+
} else if (board === ZEPHYR_PICO2) {
276+
this._ui.updateBoard("Pico 2");
277+
} else if (board === ZEPHYR_PICO_W) {
278+
this._ui.updateBoard("Pico W");
279+
} else if (board === ZEPHYR_PICO) {
280+
this._ui.updateBoard("Pico");
281+
} else {
282+
this._ui.updateBoard("Other");
283+
}
284+
}
265285
}
266286

267287
private async _switchBoardPicoSDK(

0 commit comments

Comments
 (0)