Skip to content

Commit 79786dc

Browse files
committed
Add a test post refresh hook
1 parent 482d882 commit 79786dc

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

build/gulpfile.vscode.linux.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,14 @@ function prepareSnapPackage(arch) {
206206
.pipe(replace('@@VERSION@@', `${packageJson.version}-${linuxPackageRevision}`))
207207
.pipe(rename('snap/snapcraft.yaml'));
208208

209+
const postRefreshHook = gulp.src('resources/linux/snap/hooks/post-refresh', { base: '.' })
210+
.pipe(replace('@@NAME@@', product.applicationName))
211+
.pipe(rename('snap/hooks/post-refresh'));
212+
209213
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
210214
.pipe(rename('electron-launch'));
211215

212-
const all = es.merge(desktop, icon, code, snapcraft, electronLaunch);
216+
const all = es.merge(desktop, icon, code, snapcraft, electronLaunch, postRefreshHook);
213217

214218
return all.pipe(vfs.dest(destination));
215219
};
@@ -219,7 +223,7 @@ function buildSnapPackage(arch) {
219223
const snapBuildPath = getSnapBuildPath(arch);
220224
const snapFilename = `${product.applicationName}-${packageJson.version}-${linuxPackageRevision}-${arch}.snap`;
221225
return shell.task([
222-
`chmod +x ${snapBuildPath}/electron-launch`,
226+
`chmod a+x ${snapBuildPath}/electron-launch ${snapBuildPath}/hooks/post-refresh`,
223227
`snapcraft --version`,
224228
`cd ${snapBuildPath} && snapcraft snap --output ../${snapFilename}`
225229
]);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# @@NAME@@ --snap-update
4+
echo "refresh hook" | c -

0 commit comments

Comments
 (0)