Skip to content

Commit 44d04ad

Browse files
committed
Rename IFileSystemCreateLinkOptions.linkPath to newLinkPath because it still wasn't clear enough
1 parent f484ef8 commit 44d04ad

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎apps/rush-lib/src/logic/InstallManager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export class InstallManager {
334334
}
335335

336336
FileSystem.createSymbolicLinkJunction({
337-
linkPath: localPackageManagerToolFolder,
337+
newLinkPath: localPackageManagerToolFolder,
338338
linkTargetPath: packageManagerToolFolder
339339
});
340340

‎apps/rush-lib/src/logic/base/BaseLinkManager.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ export abstract class BaseLinkManager {
2626
protected _rushConfiguration: RushConfiguration;
2727

2828
protected static _createSymlink(options: IBaseLinkManagerCreateSymlinkOptions): void {
29-
FileSystem.ensureFolder(path.dirname(options.linkPath));
29+
FileSystem.ensureFolder(path.dirname(options.newLinkPath));
3030

3131
if (options.symlinkKind === SymlinkKind.Directory) {
3232
// For directories, we use a Windows "junction". On Unix, this produces a regular symlink.
3333
FileSystem.createSymbolicLinkJunction({
3434
linkTargetPath: options.linkTargetPath,
35-
linkPath: options.linkPath
35+
newLinkPath: options.newLinkPath
3636
});
3737
} else {
3838
if (process.platform === 'win32') {
3939
// For files, we use a Windows "hard link", because creating a symbolic link requires
4040
// administrator permission.
4141
FileSystem.createHardLink({
4242
linkTargetPath: options.linkTargetPath,
43-
linkPath: options.linkPath
43+
newLinkPath: options.newLinkPath
4444
});
4545
} else {
4646
// However hard links seem to cause build failures on Mac, so for all other operating systems
4747
// we use symbolic links for this case.
4848
FileSystem.createSymbolicLinkFile({
4949
linkTargetPath: options.linkTargetPath,
50-
linkPath: options.linkPath
50+
newLinkPath: options.newLinkPath
5151
});
5252
}
5353
}
@@ -106,7 +106,7 @@ export abstract class BaseLinkManager {
106106
// If there are no children, then we can symlink the entire folder
107107
BaseLinkManager._createSymlink({
108108
linkTargetPath: localPackage.symlinkTargetFolderPath,
109-
linkPath: localPackage.folderPath,
109+
newLinkPath: localPackage.folderPath,
110110
symlinkKind: SymlinkKind.Directory
111111
});
112112
} else {
@@ -142,7 +142,7 @@ export abstract class BaseLinkManager {
142142

143143
BaseLinkManager._createSymlink({
144144
linkTargetPath: linkTarget,
145-
linkPath: linkSource,
145+
newLinkPath: linkSource,
146146
symlinkKind
147147
});
148148
}

‎apps/rush-lib/src/logic/npm/NpmLinkManager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export class NpmLinkManager extends BaseLinkManager {
325325

326326
if (FileSystem.exists(commonBinFolder)) {
327327
NpmLinkManager._createSymlink({
328-
linkPath: projectBinFolder,
328+
newLinkPath: projectBinFolder,
329329
linkTargetPath: commonBinFolder,
330330
symlinkKind: SymlinkKind.Directory
331331
});

‎common/reviews/api/node-core-library.api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ interface IFileSystemCopyFileOptions {
7777

7878
// @public
7979
interface IFileSystemCreateLinkOptions {
80-
linkPath: string;
8180
linkTargetPath: string;
81+
newLinkPath: string;
8282
}
8383

8484
// @public

‎libraries/node-core-library/src/FileSystem.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export interface IFileSystemCreateLinkOptions {
156156
/**
157157
* The new path for the new symlink link to be created.
158158
*/
159-
linkPath: string;
159+
newLinkPath: string;
160160
}
161161

162162
/**
@@ -451,31 +451,31 @@ export class FileSystem {
451451
*/
452452
public static createSymbolicLinkJunction(options: IFileSystemCreateLinkOptions): void {
453453
// For directories, we use a Windows "junction". On POSIX operating systems, this produces a regular symlink.
454-
fsx.symlinkSync(options.linkTargetPath, options.linkPath, 'junction');
454+
fsx.symlinkSync(options.linkTargetPath, options.newLinkPath, 'junction');
455455
}
456456

457457
/**
458458
* Creates a symbolic link to a file (on Windows this requires elevated permissionsBits).
459459
* Behind the scenes it uses `fs.symlinkSync()`.
460460
*/
461461
public static createSymbolicLinkFile(options: IFileSystemCreateLinkOptions): void {
462-
fsx.symlinkSync(options.linkTargetPath, options.linkPath, 'file');
462+
fsx.symlinkSync(options.linkTargetPath, options.newLinkPath, 'file');
463463
}
464464

465465
/**
466466
* Creates a symbolic link to a folder (on Windows this requires elevated permissionsBits).
467467
* Behind the scenes it uses `fs.symlinkSync()`.
468468
*/
469469
public static createSymbolicLinkFolder(options: IFileSystemCreateLinkOptions): void {
470-
fsx.symlinkSync(options.linkTargetPath, options.linkPath, 'dir');
470+
fsx.symlinkSync(options.linkTargetPath, options.newLinkPath, 'dir');
471471
}
472472

473473
/**
474474
* Creates a hard link.
475475
* Behind the scenes it uses `fs.linkSync()`.
476476
*/
477477
public static createHardLink(options: IFileSystemCreateLinkOptions): void {
478-
fsx.linkSync(options.linkTargetPath, options.linkPath);
478+
fsx.linkSync(options.linkTargetPath, options.newLinkPath);
479479
}
480480

481481
/**

0 commit comments

Comments
 (0)