From 60e273754035f514ac95f13178114365467289ea Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 13 Sep 2018 11:14:33 +0200 Subject: [PATCH] cleanup linux gulpfile --- build/gulpfile.vscode.linux.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index f518764d1d2..349a2b979e2 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -29,18 +29,17 @@ function prepareDebPackage(arch) { return function () { const desktop = gulp.src('resources/linux/code.desktop', { base: '.' }) - .pipe(replace('@@NAME_LONG@@', product.nameLong)) - .pipe(replace('@@NAME_SHORT@@', product.nameShort)) - .pipe(replace('@@NAME@@', product.applicationName)) - .pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('usr/share/applications/' + product.applicationName + '.desktop')); const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' }) + .pipe(rename('usr/share/applications/' + product.applicationName + '-url-handler.desktop')); + + const desktops = es.merge(desktop, desktopUrlHandler) .pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_SHORT@@', product.nameShort)) .pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@ICON@@', product.applicationName)) - .pipe(rename('usr/share/applications/' + product.applicationName + '-url-handler.desktop')); + .pipe(replace('@@URLPROTOCOL@@', product.urlProtocol)); const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) @@ -85,7 +84,7 @@ function prepareDebPackage(arch) { .pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@')) .pipe(rename('DEBIAN/postinst')); - const all = es.merge(control, postinst, postrm, prerm, desktop, desktopUrlHandler, appdata, icon, code); + const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, code); return all.pipe(vfs.dest(destination)); }; @@ -114,19 +113,18 @@ function prepareRpmPackage(arch) { return function () { const desktop = gulp.src('resources/linux/code.desktop', { base: '.' }) - .pipe(replace('@@NAME_LONG@@', product.nameLong)) - .pipe(replace('@@NAME_SHORT@@', product.nameShort)) - .pipe(replace('@@NAME@@', product.applicationName)) - .pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '.desktop')); const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' }) - .pipe(replace('@@NAME_LONG@@', product.nameLong)) - .pipe(replace('@@NAME_SHORT@@', product.nameShort)) - .pipe(replace('@@NAME@@', product.applicationName)) - .pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '-url-handler.desktop')); + const desktops = es.merge(desktop, desktopUrlHandler) + .pipe(replace('@@NAME_LONG@@', product.nameLong)) + .pipe(replace('@@NAME_SHORT@@', product.nameShort)) + .pipe(replace('@@NAME@@', product.applicationName)) + .pipe(replace('@@ICON@@', product.applicationName)) + .pipe(replace('@@URLPROTOCOL@@', product.urlProtocol)); + const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME@@', product.applicationName)) @@ -156,7 +154,7 @@ function prepareRpmPackage(arch) { const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' }) .pipe(rename('SOURCES/' + product.applicationName + '.xpm')); - const all = es.merge(code, desktop, desktopUrlHandler, appdata, icon, spec, specIcon); + const all = es.merge(code, desktops, appdata, icon, spec, specIcon); return all.pipe(vfs.dest(getRpmBuildPath(rpmArch))); };