Move bin command to /usr/share/<app>/bin

/usr/bin/<app> now symlinks to the launcher. This makes the CLI
accessible in the zip archive version.

Fixes #4426
This commit is contained in:
Daniel Imms 2016-04-04 16:25:12 -07:00
parent db6f2c3a53
commit 6e113d01f0
3 changed files with 11 additions and 5 deletions

View file

@ -261,7 +261,7 @@ function prepareDebPackage(arch) {
return function () {
var shortcut = gulp.src('resources/linux/bin/code.sh', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename('usr/bin/' + product.applicationName));
.pipe(rename('usr/share/' + product.applicationName + '/bin/' + product.applicationName));
var desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
.pipe(replace('@@NAME_LONG@@', product.nameLong))
@ -337,7 +337,7 @@ function prepareRpmPackage(arch) {
return function () {
var shortcut = gulp.src('resources/linux/bin/code.sh', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename('BUILD/usr/bin/' + product.applicationName));
.pipe(rename('BUILD/usr/share/' + product.applicationName + '/bin/' + product.applicationName));
var desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
.pipe(replace('@@NAME_LONG@@', product.nameLong))

View file

@ -3,6 +3,10 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Symlink bin command to /usr/bin
rm -f /usr/bin/@@NAME@@
ln -s /usr/share/@@NAME@@/bin/@@NAME@@ /usr/bin/@@NAME@@
# 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.

View file

@ -15,11 +15,9 @@ AutoReq: 0
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle.
%install
mkdir -p %{buildroot}/usr/bin
mkdir -p %{buildroot}/usr/share/@@NAME@@
mkdir -p %{buildroot}/usr/share/applications
mkdir -p %{buildroot}/usr/share/pixmaps
cp -r usr/bin/@@NAME@@ %{buildroot}/usr/bin
cp -r usr/share/@@NAME@@/* %{buildroot}/usr/share/@@NAME@@
cp -r usr/share/applications/@@NAME@@.desktop %{buildroot}/usr/share/applications
cp -r usr/share/pixmaps/@@NAME@@.png %{buildroot}/usr/share/pixmaps
@ -30,6 +28,10 @@ if [ "@@NAME@@" = "code" ]; then
rm -f /usr/local/bin/code
fi
# Symlink bin command to /usr/bin2
rm -f /usr/bin/@@NAME@@
ln -s /usr/share/@@NAME@@/bin/@@NAME@@ /usr/bin/@@NAME@@
# Register yum repository
# TODO: #229: Enable once the yum repository is signed
#if [ "@@NAME@@" != "code-oss" ]; then
@ -43,7 +45,7 @@ fi
%files
%defattr(-,root,root)
/usr/bin/@@NAME@@
/usr/share/@@NAME@@/
/usr/share/@@NAME@@/bin/@@NAME@@
/usr/share/applications/@@NAME@@.desktop
/usr/share/pixmaps/@@NAME@@.png