Skip to content

Commit 0bf2b8a

Browse files
author
Kinga Iakab
committed
fix links
1 parent b0d049d commit 0bf2b8a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/commands/link.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ function promptProjectName() {
2121
}
2222

2323
async function handle(args, options, logger) {
24-
const link = await Links.find({ path: process.cwd() });
24+
const projectPath = process.cwd();
25+
const link = await Links.find({ projectPath });
2526

2627
if (link !== null) {
2728
logger.info('This project is already linked.');
2829
} else {
2930
const answers = await promptProjectName();
3031
const data = {
3132
name: answers.name,
32-
projectPath: process.cwd(),
3333
host: answers.host,
34+
projectPath,
3435
};
3536
const link = await Links.create(data);
3637

src/commands/unlink.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function confirmUnlink() {
1111
}
1212

1313
async function handle(args, options, logger) {
14-
const link = await Links.find({ path: process.cwd() });
14+
const projectPath = process.cwd();
15+
const link = await Links.find({ projectPath });
1516

1617
if (link === null) {
1718
logger.info('The project is not linked at all.');

0 commit comments

Comments
 (0)