-
Notifications
You must be signed in to change notification settings - Fork 739
Allow ln destination to be an existing directory, fixes #832 #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
3fe1a67
4008596
50e6ca8
582414d
9392c55
946ab48
c57f7ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,6 @@ test('destination already exists inside directory', t => { | |
const result = shell.ln('-s', 'file1', './'); | ||
t.truthy(shell.error()); | ||
t.is(result.code, 1); | ||
shell.cd('..'); | ||
}); | ||
|
||
test('non-existent source', t => { | ||
|
@@ -149,12 +148,13 @@ test('Inside existing directory', t => { | |
shell.cd(t.context.tmp); | ||
const result = shell.ln('-s', 'external/node_script.js', './'); | ||
t.is(result.code, 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: also assert There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going to add those. It's not been done anywhere in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check. |
||
t.falsy(result.stderr); | ||
t.falsy(shell.error()); | ||
t.truthy(fs.existsSync('node_script.js')); | ||
t.is( | ||
fs.readFileSync('external/node_script.js').toString(), | ||
fs.readFileSync('node_script.js').toString() | ||
); | ||
shell.rm('node_script.js'); | ||
shell.cd('..'); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
isDirectory()
accepts arguments: https://nodejs.org/api/fs.html#fs_stats_isdirectoryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right. That was definitely not on purpose. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.