Skip to content

Commit 6d05f39

Browse files
committed
Rename to value
1 parent 5dd1a7d commit 6d05f39

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/packageManager/AbsolutePath.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import { isAbsolute, resolve } from "path";
77

88
export class AbsolutePath{
9-
constructor(public path: string) {
10-
if (!isAbsolute(path)) {
9+
constructor(public value: string) {
10+
if (!isAbsolute(value)) {
1111
throw new Error("The path must be absolute");
1212
}
1313
}

src/packageManager/InstallablePackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function getAbsoluteInstallTestPath(pkg: Package, extensionPath: string): Absolu
4242
}
4343

4444
function getAbsoluteBinaries(pkg: Package, extensionPath: string): AbsolutePath[] {
45-
let basePath = getAbsoluteInstallPath(pkg, extensionPath).path;
45+
let basePath = getAbsoluteInstallPath(pkg, extensionPath).value;
4646
if (pkg.binaries) {
4747
return pkg.binaries.map(value => AbsolutePath.getAbsolutePath(basePath, value));
4848
}

src/packageManager/PackageFilterer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ async function filterAlreadyInstalledPackages(packages: InstallablePackage[]): P
4343
return true;
4444
}
4545

46-
return !(await util.fileExists(testPath.path));
46+
return !(await util.fileExists(testPath.value));
4747
});
4848
}

src/packageManager/ZipInstaller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function InstallZip(buffer: Buffer, description: string, destinatio
2626
zipFile.readEntry();
2727

2828
zipFile.on('entry', (entry: yauzl.Entry) => {
29-
let absoluteEntryPath = path.resolve(destinationInstallPath.path, entry.fileName);
29+
let absoluteEntryPath = path.resolve(destinationInstallPath.value, entry.fileName);
3030

3131
if (entry.fileName.endsWith('/')) {
3232
// Directory - create it
@@ -50,7 +50,7 @@ export async function InstallZip(buffer: Buffer, description: string, destinatio
5050
return reject(new NestedError('Error creating directory for zip file entry', err));
5151
}
5252

53-
let binaryPaths = binaries && binaries.map(binary => binary.path);
53+
let binaryPaths = binaries && binaries.map(binary => binary.value);
5454

5555
// Make sure executable files have correct permissions when extracted
5656
let fileMode = binaryPaths && binaryPaths.indexOf(absoluteEntryPath) !== -1

test/unitTests/Packages/ZipInstaller.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ suite('ZipInstaller', () => {
5050
test('The folder is unzipped and all the files are present at the expected paths', async () => {
5151
await InstallZip(testZip.buffer, fileDescription, installationPath, [], eventStream);
5252
for (let elem of testZip.files) {
53-
let filePath = path.join(installationPath.path, elem.path);
53+
let filePath = path.join(installationPath.value, elem.path);
5454
expect(await util.fileExists(filePath)).to.be.true;
5555
}
5656
});
@@ -65,11 +65,11 @@ suite('ZipInstaller', () => {
6565

6666
test('The folder is unzipped and the binaries have the expected permissions(except on Windows)', async () => {
6767
if (!((await PlatformInformation.GetCurrent()).isWindows())) {
68-
let absoluteBinaries = binaries.map(binary => AbsolutePath.getAbsolutePath(installationPath.path, binary.path));
68+
let absoluteBinaries = binaries.map(binary => AbsolutePath.getAbsolutePath(installationPath.value, binary.path));
6969
await InstallZip(testZip.buffer, fileDescription, installationPath, absoluteBinaries, eventStream);
7070
for (let binaryPath of absoluteBinaries) {
71-
expect(await util.fileExists(binaryPath.path)).to.be.true;
72-
let mode = (await fs.stat(binaryPath.path)).mode;
71+
expect(await util.fileExists(binaryPath.value)).to.be.true;
72+
let mode = (await fs.stat(binaryPath.value)).mode;
7373
expect(mode & 0o7777).to.be.equal(0o755, `Expected mode for path ${binaryPath}`);
7474
}
7575
}

0 commit comments

Comments
 (0)