Skip to content

Breaks when files contain newlines #13

@haynesgt

Description

@haynesgt

e.g. if you touch $'a\nb' in a watched directory you get

Error: SyntaxError: Unexpected end of JSON input -> { "type": "OPEN", "file": "/tmp/thing/a
    at /tmp/in/node_modules/inotifywait/lib/inotifywait.js:85:32
    at /tmp/in/node_modules/lazy/lazy.js:99:35
    at Lazy.<anonymous> (/tmp/in/node_modules/lazy/lazy.js:74:37)
    at Lazy.emit (events.js:315:20)
    at Lazy.EventEmitter.emit (domain.js:506:15)
    at Lazy.<anonymous> (/tmp/in/node_modules/lazy/lazy.js:74:22)
    at Lazy.emit (events.js:315:20)
    at Lazy.EventEmitter.emit (domain.js:506:15)
    at yieldTo (/tmp/in/node_modules/lazy/lazy.js:181:18)

You need to use the csv output option from inotifywait and parse that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions