Skip to content

Commit e771386

Browse files
authored
Merge pull request #21 from zapta/main
Fixed windows task.cmd file and a few other cleanups.
2 parents b3334f7 + ad027c0 commit e771386

4 files changed

Lines changed: 30 additions & 15 deletions

File tree

constants.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// src/constants.js
2+
//
3+
// ---------------------------------------------------------------
4+
// Centralized constants for the Apio VS Code extension.
5+
// ---------------------------------------------------------------
6+
7+
// GitHub repository that hosts the pre-built Apio bundles
8+
// https://github.com/FPGAwars/apio-dev-builds/releases
9+
const APIO_RELEASE_GITHUB_REPO = "FPGAwars/apio-dev-builds";
10+
11+
// Release tag (YYYY-MM-DD) – matches git tag and PyPI version
12+
// Change ONLY this line when you publish a new daily build.
13+
const APIO_RELEASE_TAG = "2025-12-01";
14+
15+
// Export everything for require()
16+
module.exports = {
17+
APIO_RELEASE_GITHUB_REPO,
18+
APIO_RELEASE_TAG,
19+
};

downloader.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ const zipExtract = require("extract-zip");
1717
const tar = require("tar");
1818

1919
// Local imports
20+
const constants = require("./constants.js");
2021
const platforms = require("./platforms.js");
2122
const apioLog = require("./apio-log.js");
2223
const jsonUtils = require("./json-utils.js");
2324
const utils = require("./utils.js");
2425

25-
// Where to find the apio bundle on github.
26-
// https://github.com/FPGAwars/apio-dev-builds/releases
27-
const githubRepo = "FPGAwars/apio-dev-builds";
28-
const apioReleaseTag = "2025-12-01";
29-
3026
// Download url and local package name
3127
const downloadMetadataFileName = "download-metadata.json";
3228
let _downloadSrcUrl = null;
@@ -42,11 +38,15 @@ function init() {
4238
);
4339

4440
// Determine download information.
45-
const yyyymmdd = apioReleaseTag.replaceAll("-", "");
41+
const yyyymmdd = constants.APIO_RELEASE_TAG.replaceAll("-", "");
4642
const platformId = platforms.getPlatformId();
43+
const baseUrl =
44+
"https://github.com/" +
45+
constants.APIO_RELEASE_GITHUB_REPO +
46+
"/releases/download/" +
47+
constants.APIO_RELEASE_TAG +
48+
"/";
4749
const ext = platforms.isWindows() ? "zip" : "tgz";
48-
49-
const baseUrl = `https://github.com/${githubRepo}/releases/download/${apioReleaseTag}/`;
5050
const packageFileName = `apio-${platformId}-${yyyymmdd}-bundle.${ext}`;
5151
_downloadSrcUrl = baseUrl + packageFileName;
5252
_downloadDstFilePath = path.join(utils.apioHomeDir(), packageFileName);

extension.js renamed to main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ async function execCommandsInATask(cmds) {
341341
`echo $ ${cmd}`,
342342
`${cmd}`,
343343
`set "ERR=%errorlevel%"`,
344-
`if !ERR! neq 0 (`,
344+
`if %ERR% neq 0 (`,
345345
` echo.`,
346346
` echo ${failMessage}`,
347-
` exit /b !ERR!`,
347+
` exit /b %ERR%`,
348348
`)`,
349349
]);
350350
const lines = [

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"onStartupFinished",
3434
"workspaceContains:apio.ini"
3535
],
36-
"main": "./extension.js",
36+
"main": "./main.js",
3737
"contributes": {
3838
"viewsContainers": {
3939
"activitybar": [
@@ -49,28 +49,24 @@
4949
{
5050
"name": "NOTICE",
5151
"id": "apio.sidebar.notice",
52-
"icon": "media/sidebar-icon.svg",
5352
"type": "webview",
5453
"when": "apio.sidebar.notice.enabled"
5554
},
5655
{
5756
"name": "PROJECT",
5857
"id": "apio.sidebar.project",
59-
"icon": "media/sidebar-icon.svg",
6058
"type": "tree",
6159
"when": "apio.sidebar.project.enabled"
6260
},
6361
{
6462
"name": "TOOLS",
6563
"id": "apio.sidebar.tools",
66-
"icon": "media/sidebar-icon.svg",
6764
"type": "tree",
6865
"when": "apio.sidebar.tools.enabled"
6966
},
7067
{
7168
"name": "HELP",
7269
"id": "apio.sidebar.help",
73-
"icon": "media/sidebar-icon.svg",
7470
"type": "tree",
7571
"when": "apio.sidebar.help.enabled"
7672
}

0 commit comments

Comments
 (0)