From 81be2dd453d19479b7f4b4aef9e695582e1cc9a9 Mon Sep 17 00:00:00 2001 From: Roman Lamsal Date: Fri, 7 Oct 2022 11:18:06 +0200 Subject: [PATCH 1/2] fix: watch command ignoring in cwd --- src/watch/index.ts | 1 + tests/specs/watch.ts | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/watch/index.ts b/src/watch/index.ts index 3eb2504e..73add2e0 100644 --- a/src/watch/index.ts +++ b/src/watch/index.ts @@ -118,6 +118,7 @@ export const watchCommand = command({ const watcher = watch( argv._, { + cwd: process.cwd(), ignoreInitial: true, ignored: [ // Hidden directories like .git diff --git a/tests/specs/watch.ts b/tests/specs/watch.ts index fe202250..e28501f0 100644 --- a/tests/specs/watch.ts +++ b/tests/specs/watch.ts @@ -161,12 +161,13 @@ export default testSuite(async ({ describe }, fixturePath: string) => { }); const tsxProcess = tsx({ + cwd: fixture.path, args: [ 'watch', '--clear-screen=false', - `--ignore=${path.join(fixture.path, fileA)}`, - `--ignore=${path.join(fixture.path, 'directory/*')}`, - path.join(fixture.path, entryFile), + `--ignore=${fileA}`, + '--ignore=directory/*', + entryFile, ], }); From 5bf5d7f7e4713dc2ce6aec8ffe6bb87b911c16fe Mon Sep 17 00:00:00 2001 From: hiroki osame Date: Fri, 7 Oct 2022 06:09:55 -0400 Subject: [PATCH 2/2] Update tests/specs/watch.ts --- tests/specs/watch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/specs/watch.ts b/tests/specs/watch.ts index e28501f0..69105889 100644 --- a/tests/specs/watch.ts +++ b/tests/specs/watch.ts @@ -166,7 +166,7 @@ export default testSuite(async ({ describe }, fixturePath: string) => { 'watch', '--clear-screen=false', `--ignore=${fileA}`, - '--ignore=directory/*', + `--ignore=${path.join(fixture.path, 'directory/*')}`, entryFile, ], });