Skip to content

Commit

Permalink
fix: Deno.remove() to properly remove dangling symlinks (denoland#3860)
Browse files Browse the repository at this point in the history
For some reason, the unit tests for Deno.remove() were not being imported to 
unit_tests.ts and, consequently, not being executed. Thus, I imported them, 
refactored some existent ones and wrote new ones for the symlink removal case.

Since the creation of a symlink is not implemented for Windows yet, assertions
that consider this state were added when the tests are executed in this OS.
  • Loading branch information
rafaelvargas committed Feb 3, 2020
1 parent f168597 commit 55063dd
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 126 deletions.
4 changes: 2 additions & 2 deletions cli/js/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface RemoveOption {
recursive?: boolean;
}

/** Removes the named file or directory synchronously. Would throw
/** Removes the named file, directory or symlink synchronously. Would throw
* error if permission denied, not found, or directory not empty if `recursive`
* set to false.
* `recursive` is set to false by default.
Expand All @@ -17,7 +17,7 @@ export function removeSync(path: string, options: RemoveOption = {}): void {
sendSync(dispatch.OP_REMOVE, { path, recursive: !!options.recursive });
}

/** Removes the named file or directory. Would throw error if
/** Removes the named file, directory or symlink. Would throw error if
* permission denied, not found, or directory not empty if `recursive` set
* to false.
* `recursive` is set to false by default.
Expand Down
Loading

0 comments on commit 55063dd

Please sign in to comment.