Skip to content

shouldFork -check is not working properly if there is a dash in the file path #1554

@sampsasaarela

Description

@sampsasaarela
  • nodemon -v: 1.18.11
  • node -v: v8.10.0
  • Operating system/terminal environment: macosx
  • Using Docker? What image: node-alpine

Expected behaviour

Start child process as forked

Actual behaviour

Starts child process as spawned

Steps to reproduce

  1. Create new app with path like ./my-app/index.js
  2. Start nodemon ./my-app/index.js

I think the problem is in lib/monitor/run.js#L94:
firstArg.indexOf('-') === -1 && // don't fork if there's a node exec arg

this return false, since my app path has - in its path. Or am I missing something here? If I rename my app like ./my-app/index.js -> ./myapp/index.jsit works and starts as forked as expected. Not sure what is the purpose of this indexOf check here? Could it be just removed because there is also executable === 'node' check?

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleno activity for 2 weeks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions