Specify binaries relative to installPath

This commit is contained in:
Dustin Campbell 2016-11-03 09:35:33 -07:00
Родитель d217a035d3
Коммит 525acb703f
2 изменённых файлов: 22 добавлений и 17 удалений

Просмотреть файл

@ -76,7 +76,7 @@
"win7-x86"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -87,7 +87,7 @@
"win7-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -98,7 +98,7 @@
"osx.10.11-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -109,7 +109,7 @@
"centos.7-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -120,7 +120,7 @@
"debian.8-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -131,7 +131,7 @@
"fedora.23-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -142,7 +142,7 @@
"opensuse.13.2-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -153,7 +153,7 @@
"rhel.7-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./.OmniSharp"
]
},
{
@ -164,7 +164,7 @@
"ubuntu.14.04-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{
@ -175,7 +175,7 @@
"ubuntu.16.04-x64"
],
"binaries": [
"./.omnisharp-coreclr/OmniSharp"
"./OmniSharp"
]
},
{

Просмотреть файл

@ -67,7 +67,8 @@ export class PackageManager {
// Convert relative binary paths to absolute
for (let pkg of this.allPackages) {
if (pkg.binaries) {
pkg.binaries = pkg.binaries.map(value => path.resolve(util.getExtensionPath(), value));
let basePath = util.getExtensionPath();
pkg.binaries = pkg.binaries.map(value => path.resolve(getBaseInstallPath(pkg), value));
}
}
@ -101,6 +102,15 @@ export class PackageManager {
}
}
function getBaseInstallPath(pkg: Package): string {
let basePath = util.getExtensionPath();
if (pkg.installPath) {
basePath = path.join(basePath, pkg.installPath);
}
return basePath;
}
function getNoopStatus(): Status {
return {
setMessage: text => { },
@ -231,12 +241,7 @@ function installPackage(pkg: Package, logger: Logger, status?: Status): Promise<
zipFile.readEntry();
zipFile.on('entry', (entry: yauzl.Entry) => {
let basePath = util.getExtensionPath();
if (pkg.installPath) {
basePath = path.join(basePath, pkg.installPath);
}
let absoluteEntryPath = path.resolve(basePath, entry.fileName);
let absoluteEntryPath = path.resolve(getBaseInstallPath(pkg), entry.fileName);
if (entry.fileName.endsWith('/')) {
// Directory - create it