Skip to content

Commit f66e30f

Browse files
authored
Merge pull request #79 from zapta/main
Task completed messages are now printed in theme colors.
2 parents b34236d + 3a5ec2d commit f66e30f

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

src/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ const TOOLS_TREE = [
163163
"examples.json",
164164
)}`,
165165
],
166-
completionMsgssss: [
166+
completionMsgs: [
167167
"The Apio examples list was retrieved successfully.",
168-
"Please complete and submit the Create Apio Example Project form.",
168+
"Please complete and submit the Create Apio Example Project form above.",
169169
],
170170
cmdId: "apio.projectFromExample",
171171
},

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const APIO_CLI_RELEASE_REPO = "fpgawars/apio";
1212
// Release tag (YYYY-MM-DD) – matches git tag and PyPI version
1313
// Change ONLY this line when you publish a new daily build.
1414
//
15-
const APIO_CLI_RELEASE_TAG = "2026-01-28";
15+
const APIO_CLI_RELEASE_TAG = "2026-01-30";
1616

1717
// Export for require()
1818
module.exports = {

src/tasks.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ async function execCommandsInATask(
4848

4949
// 3. Create the batch file.
5050
const okMessage = completionMsgs || ["Task completed successfully."];
51+
// For custom completion messages we use info color since we don't know
52+
// their nature. Could also add a style attribution to the action
53+
// specification in commands.js to provide more control.
54+
const okStyle = (completionMsgs)? "INFO" : "OK";
5155
const failMessage = "Task failed.";
5256
const titleMessage = `${title}`;
5357

58+
// The path to the apio bin so we can invoke 'apio api echo ...'.
59+
const apioBin = utils.apioBinaryPath();
60+
5461
let shell;
5562
let shellArgs;
5663
if (platforms.isWindows()) {
@@ -66,7 +73,7 @@ async function execCommandsInATask(
6673
`set "ERR=%errorlevel%"`,
6774
`if %ERR% neq 0 (`,
6875
` echo.`,
69-
` echo ${failMessage}`,
76+
` ${apioBin} api echo -t "${failMessage}" -s ERROR`,
7077
preserveExitCode ? ` exit /b %ERR%` : ` exit /b 0`,
7178
`)`,
7279
]);
@@ -80,7 +87,7 @@ async function execCommandsInATask(
8087
" ",
8188
`echo.`,
8289
// `echo ${okMessage}`,
83-
...okMessage.map((s) => `echo ${s}`),
90+
...okMessage.map((s) => `${apioBin} api echo -t "${s}" -s ${okStyle}`),
8491
// ...okMessage.map((s) => makeGreenEcho(s, true)),
8592
"exit /b 0",
8693
];
@@ -100,7 +107,7 @@ async function execCommandsInATask(
100107
`ERR=$?`,
101108
`if [ $ERR -ne 0 ]; then`,
102109
` echo`,
103-
` echo "${failMessage}"`,
110+
` ${apioBin} api echo -t "${failMessage}" -s ERROR`,
104111
preserveExitCode ? ` exit $ERR` : ` exit 0`,
105112
`fi`,
106113
]);
@@ -113,7 +120,7 @@ async function execCommandsInATask(
113120
" ",
114121
"echo",
115122
// `echo "${okMessage}"`,
116-
...okMessage.map((s) => `echo "${s}"`),
123+
...okMessage.map((s) => `${apioBin} api echo -t "${s}" -s ${okStyle}`),
117124
// ...okMessage.map((s) => makeGreenEcho(s, false)),
118125
"exit 0",
119126
];

test/extension.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ suite("Integration tests", () => {
228228
await briefDelay();
229229

230230
// Issue test command
231-
await vscode.commands.executeCommand("apio.test");
231+
await vscode.commands.executeCommand("apio.testAll");
232232
await briefDelay();
233233

234234
// Check generated files

0 commit comments

Comments
 (0)