@vscode/gulp-electron 1.37.0 → 1.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/download.js +1 -1
- package/src/win32.js +41 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/gulp-electron",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.1",
|
|
4
4
|
"description": "gulp plugin for packaging Electron into VS Code",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://github.com/microsoft/vscode-gulp-electron.git"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=22"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"gulpplugin",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"homepage": "https://github.com/microsoft/vscode-gulp-electron",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@electron/get": "^4.0.1",
|
|
32
|
-
"@octokit/rest": "^
|
|
32
|
+
"@octokit/rest": "^22.0.0",
|
|
33
33
|
"event-stream": "3.3.4",
|
|
34
34
|
"gulp-filter": "^5.1.0",
|
|
35
35
|
"gulp-rename": "1.2.2",
|
package/src/download.js
CHANGED
|
@@ -8,7 +8,7 @@ var es = require("event-stream");
|
|
|
8
8
|
var zfs = require("gulp-vinyl-zip");
|
|
9
9
|
var filter = require("gulp-filter");
|
|
10
10
|
const { Octokit } = require("@octokit/rest");
|
|
11
|
-
const got = require("got");
|
|
11
|
+
const { got } = require("got");
|
|
12
12
|
const sumchecker = require('sumchecker');
|
|
13
13
|
|
|
14
14
|
async function getDownloadUrl(
|
package/src/win32.js
CHANGED
|
@@ -51,7 +51,13 @@ function getSignTool() {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
exports.getAppPath = function (opts) {
|
|
54
|
-
|
|
54
|
+
if (opts.createVersionedResources) {
|
|
55
|
+
if (!opts.productVersionString) {
|
|
56
|
+
throw new Error("productVersionString must be defined.");
|
|
57
|
+
}
|
|
58
|
+
return path.join(opts.productVersionString, "resources", "app");
|
|
59
|
+
}
|
|
60
|
+
return path.join("resources", "app");
|
|
55
61
|
};
|
|
56
62
|
|
|
57
63
|
function patchExecutable(opts) {
|
|
@@ -77,6 +83,15 @@ function patchExecutable(opts) {
|
|
|
77
83
|
"product-version": opts.productVersion,
|
|
78
84
|
};
|
|
79
85
|
|
|
86
|
+
if (opts.createVersionedResources) {
|
|
87
|
+
if (!opts.productVersionString) {
|
|
88
|
+
throw new Error("productVersionString must be defined.");
|
|
89
|
+
}
|
|
90
|
+
patch["resource-string"] = {
|
|
91
|
+
2: opts.productVersionString
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
80
95
|
if (opts.winIcon) {
|
|
81
96
|
patch.icon = opts.winIcon;
|
|
82
97
|
}
|
|
@@ -140,13 +155,37 @@ function renameApp(opts) {
|
|
|
140
155
|
});
|
|
141
156
|
}
|
|
142
157
|
|
|
158
|
+
function moveFilesExceptExecutable(opts) {
|
|
159
|
+
const versionFolder = opts.productVersionString;
|
|
160
|
+
if (!versionFolder) {
|
|
161
|
+
throw new Error("productVersionString must be defined.");
|
|
162
|
+
}
|
|
163
|
+
return es.mapSync(function (f) {
|
|
164
|
+
// Skip if the file is the renamed executable
|
|
165
|
+
if (
|
|
166
|
+
f.relative === `${opts.productName}.exe`
|
|
167
|
+
) {
|
|
168
|
+
return f;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Move other files to version subfolder
|
|
172
|
+
if (f.path && f.base) {
|
|
173
|
+
const relativePath = path.relative(f.base, f.path);
|
|
174
|
+
f.path = path.join(f.base, versionFolder, relativePath);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return f;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
143
181
|
exports.patch = function (opts) {
|
|
144
182
|
var pass = es.through();
|
|
145
183
|
|
|
146
184
|
var src = pass
|
|
147
185
|
.pipe(opts.keepDefaultApp ? es.through() : removeDefaultApp())
|
|
148
186
|
.pipe(patchExecutable(opts))
|
|
149
|
-
.pipe(renameApp(opts))
|
|
187
|
+
.pipe(renameApp(opts))
|
|
188
|
+
.pipe(opts.createVersionedResources ? moveFilesExceptExecutable(opts) : es.through());
|
|
150
189
|
|
|
151
190
|
return es.duplex(pass, src);
|
|
152
191
|
};
|