Skip to content

Commit

Permalink
fix(watch): relative paths in --ignore flag (#115)
Browse files Browse the repository at this point in the history
Co-authored-by: hiroki osame <hiroki.osame@gmail.com>
  • Loading branch information
romanlamsal and privatenumber committed Oct 7, 2022
1 parent 5062245 commit 332f242
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/watch/index.ts
Expand Up @@ -118,6 +118,7 @@ export const watchCommand = command({
const watcher = watch(
argv._,
{
cwd: process.cwd(),
ignoreInitial: true,
ignored: [
// Hidden directories like .git
Expand Down
5 changes: 3 additions & 2 deletions tests/specs/watch.ts
Expand Up @@ -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=${fileA}`,
`--ignore=${path.join(fixture.path, 'directory/*')}`,
path.join(fixture.path, entryFile),
entryFile,
],
});

Expand Down

0 comments on commit 332f242

Please sign in to comment.