Skip to content

error if current directory does not have a .gitignore file #5

Description

@alxndr

Fresh installation of v2.1.0, on MacOS Ventura 13.4.1...

I've installing precise-watcher into a brand new JS project, where I have not yet created/needed a .gitignore file. I'm finding that a basic use of precise-watcher will throw an error attempting to open .gitignore.

If I touch .gitignore and then re-run the watch task, it does not error and successfully listens for changes.

⟫ npm run -s watch
Starting precise-watcher
[Error: ENOENT: no such file or directory, open '/Users/[...]/repo/.gitignore'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/[...]/repo/.gitignore'
}
Usage: [...]

TypeError: Cannot read properties of undefined (reading 'map')
    at module.exports (/Users/[...]/repo/node_modules/precise-watcher/src/start.js:6
1:56)
    at async Object.handler (/Users/[...]/repo/node_modules/precise-watcher/bin/cli:
28:5)

Stopping precise-watcher

1 ✘ 

⟫ touch .gitignore



⟫ npm run -s watch        
Starting precise-watcher
^C
Stopping precise-watcher



⟫ 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions