diff --git a/package.json b/package.json index d32609d..745fe03 100644 --- a/package.json +++ b/package.json @@ -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" ] }, { diff --git a/src/packages.ts b/src/packages.ts index 30c2dc7..ebc7b53 100644 --- a/src/packages.ts +++ b/src/packages.ts @@ -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