Skip to content

Commit 50e6ca8

Browse files
committed
Implement first review feedback
1 parent 4008596 commit 50e6ca8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ln.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function _ln(options, source, dest) {
3636
dest = path.resolve(process.cwd(), String(dest));
3737

3838
if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory(dest)) {
39-
dest = path.resolve(dest, path.basename(sourcePath));
39+
dest = path.join(dest, path.basename(sourcePath));
4040
}
4141

4242
if (fs.existsSync(dest)) {

test/ln.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ test('destination already exists inside directory', t => {
5353
const result = shell.ln('-s', 'file1', './');
5454
t.truthy(shell.error());
5555
t.is(result.code, 1);
56-
shell.cd('..');
5756
});
5857

5958
test('non-existent source', t => {
@@ -149,12 +148,13 @@ test('Inside existing directory', t => {
149148
shell.cd(t.context.tmp);
150149
const result = shell.ln('-s', 'external/node_script.js', './');
151150
t.is(result.code, 0);
151+
t.falsy(result.stderr);
152+
t.falsy(shell.error());
152153
t.truthy(fs.existsSync('node_script.js'));
153154
t.is(
154155
fs.readFileSync('external/node_script.js').toString(),
155156
fs.readFileSync('node_script.js').toString()
156157
);
157-
shell.rm('node_script.js');
158158
shell.cd('..');
159159
});
160160

0 commit comments

Comments
 (0)