parent
2212fbbb6c
commit
572be7e529
|
@ -289,7 +289,11 @@ function prepareDebPackage(arch) {
|
|||
.pipe(es.through(function (f) { that.emit('data', f); }, function () { that.emit('end'); }));
|
||||
}));
|
||||
|
||||
var all = es.merge(control, desktop, icon, shortcut, code);
|
||||
var prerm = gulp.src('resources/linux/debian/prerm.template', { base: '.' })
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(rename('DEBIAN/prerm'))
|
||||
|
||||
var all = es.merge(control, prerm, desktop, icon, shortcut, code);
|
||||
|
||||
// Register an apt repository if this is an official build
|
||||
if (product.updateUrl && product.quality) {
|
||||
|
@ -300,6 +304,11 @@ function prepareDebPackage(arch) {
|
|||
.pipe(replace('@@ARCHITECTURE@@', debArch))
|
||||
.pipe(rename('DEBIAN/postinst'))
|
||||
all = es.merge(all, postinst);
|
||||
} else {
|
||||
var postinst = gulp.src('resources/linux/debian/postinst.oss.template', { base: '.' })
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(rename('DEBIAN/postinst'))
|
||||
all = es.merge(all, postinst);
|
||||
}
|
||||
|
||||
return all
|
||||
|
|
9
resources/linux/debian/postinst.oss.template
Executable file
9
resources/linux/debian/postinst.oss.template
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
# Register code in the alternatives system
|
||||
# Priority of 0 should never make code the default editor in auto mode as most
|
||||
# developers would prefer a terminal editor as the default.
|
||||
update-alternatives --install /usr/bin/editor editor /usr/bin/@@NAME@@ 0
|
|
@ -3,6 +3,12 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
# Register code in the alternatives system
|
||||
# Priority of 0 should never make code the default editor in auto mode as most
|
||||
# developers would prefer a terminal editor as the default.
|
||||
update-alternatives --install /usr/bin/editor editor /usr/bin/@@NAME@@ 0
|
||||
|
||||
# Register repository as an apt source
|
||||
get_apt_config_value() {
|
||||
echo $(apt-config dump | grep "$1 " | sed -e "s/$1 \"//" -e "s/\";$//")
|
||||
}
|
||||
|
|
7
resources/linux/debian/prerm.template
Executable file
7
resources/linux/debian/prerm.template
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
# Deregister code from the alternatives system
|
||||
update-alternatives --remove editor /usr/bin/@@NAME@@
|
Loading…
Reference in a new issue