Skip to content

[node-core-library] Improve FileSystem API to eliminate confusion about "source" and "target" parameters - #792

Merged
Pete Gonzalez (octogonz) merged 8 commits into
masterfrom
pgonzal/symlink-regression
Aug 29, 2018
Merged

Pete Gonzalez (octogonz) merged 8 commits into
masterfrom
pgonzal/symlink-regression

Conversation

@octogonz

Copy link
Copy Markdown
Collaborator

This includes the fix for issue #788, which was a Rush regression where the source/target parameters were reversed for fsx.symlinkSync(linkSource, linkTarget, 'file');.

The breaking change: For all APIs with two path parameters, require explicit naming of the source/target (via an options object).

This is particularly tricky when creating a symlink, since the thing we're creating was called the "source" (and the "target" is what the link points to). We clarified that as follows:

/**
 * The options for FileSystem.createSymbolicLinkJunction(), createSymbolicLinkFile(), createSymbolicLinkFolder(),
 * and createHardLink().
 *
 * @public
 */
export interface IFileSystemCreateLinkOptions {
  /**
   * The path where the new symlink link will be created.
   */
  linkPath: string;

  /**
   * The newly created symbolic link will point to this target.
   */
  linkTargetPath: string;
}

@octogonz

Copy link
Copy Markdown
Collaborator Author

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@octogonz
Pete Gonzalez (octogonz) merged commit b5e4042 into master Aug 29, 2018
@octogonz
Pete Gonzalez (octogonz) deleted the pgonzal/symlink-regression branch September 1, 2018 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants