Skip to content

Commit b6ceb94

Browse files
Merge pull request #867 from DustinCampbell/binaries-relative-to-installPath
Specify binaries relative to installPath
2 parents d217a03 + 525acb7 commit b6ceb94

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"win7-x86"
7777
],
7878
"binaries": [
79-
"./.omnisharp-coreclr/OmniSharp"
79+
"./OmniSharp"
8080
]
8181
},
8282
{
@@ -87,7 +87,7 @@
8787
"win7-x64"
8888
],
8989
"binaries": [
90-
"./.omnisharp-coreclr/OmniSharp"
90+
"./OmniSharp"
9191
]
9292
},
9393
{
@@ -98,7 +98,7 @@
9898
"osx.10.11-x64"
9999
],
100100
"binaries": [
101-
"./.omnisharp-coreclr/OmniSharp"
101+
"./OmniSharp"
102102
]
103103
},
104104
{
@@ -109,7 +109,7 @@
109109
"centos.7-x64"
110110
],
111111
"binaries": [
112-
"./.omnisharp-coreclr/OmniSharp"
112+
"./OmniSharp"
113113
]
114114
},
115115
{
@@ -120,7 +120,7 @@
120120
"debian.8-x64"
121121
],
122122
"binaries": [
123-
"./.omnisharp-coreclr/OmniSharp"
123+
"./OmniSharp"
124124
]
125125
},
126126
{
@@ -131,7 +131,7 @@
131131
"fedora.23-x64"
132132
],
133133
"binaries": [
134-
"./.omnisharp-coreclr/OmniSharp"
134+
"./OmniSharp"
135135
]
136136
},
137137
{
@@ -142,7 +142,7 @@
142142
"opensuse.13.2-x64"
143143
],
144144
"binaries": [
145-
"./.omnisharp-coreclr/OmniSharp"
145+
"./OmniSharp"
146146
]
147147
},
148148
{
@@ -153,7 +153,7 @@
153153
"rhel.7-x64"
154154
],
155155
"binaries": [
156-
"./.omnisharp-coreclr/OmniSharp"
156+
"./.OmniSharp"
157157
]
158158
},
159159
{
@@ -164,7 +164,7 @@
164164
"ubuntu.14.04-x64"
165165
],
166166
"binaries": [
167-
"./.omnisharp-coreclr/OmniSharp"
167+
"./OmniSharp"
168168
]
169169
},
170170
{
@@ -175,7 +175,7 @@
175175
"ubuntu.16.04-x64"
176176
],
177177
"binaries": [
178-
"./.omnisharp-coreclr/OmniSharp"
178+
"./OmniSharp"
179179
]
180180
},
181181
{

src/packages.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export class PackageManager {
6767
// Convert relative binary paths to absolute
6868
for (let pkg of this.allPackages) {
6969
if (pkg.binaries) {
70-
pkg.binaries = pkg.binaries.map(value => path.resolve(util.getExtensionPath(), value));
70+
let basePath = util.getExtensionPath();
71+
pkg.binaries = pkg.binaries.map(value => path.resolve(getBaseInstallPath(pkg), value));
7172
}
7273
}
7374

@@ -101,6 +102,15 @@ export class PackageManager {
101102
}
102103
}
103104

105+
function getBaseInstallPath(pkg: Package): string {
106+
let basePath = util.getExtensionPath();
107+
if (pkg.installPath) {
108+
basePath = path.join(basePath, pkg.installPath);
109+
}
110+
111+
return basePath;
112+
}
113+
104114
function getNoopStatus(): Status {
105115
return {
106116
setMessage: text => { },
@@ -231,12 +241,7 @@ function installPackage(pkg: Package, logger: Logger, status?: Status): Promise<
231241
zipFile.readEntry();
232242

233243
zipFile.on('entry', (entry: yauzl.Entry) => {
234-
let basePath = util.getExtensionPath();
235-
if (pkg.installPath) {
236-
basePath = path.join(basePath, pkg.installPath);
237-
}
238-
239-
let absoluteEntryPath = path.resolve(basePath, entry.fileName);
244+
let absoluteEntryPath = path.resolve(getBaseInstallPath(pkg), entry.fileName);
240245

241246
if (entry.fileName.endsWith('/')) {
242247
// Directory - create it

0 commit comments

Comments
 (0)