Skip to content

--on-change-only / -C seemingly does nothing #1742

@ejulen

Description

@ejulen
  • nodemon -v: 2.0.4
  • node -v: v12.17.0
  • Operating system/terminal environment: Ubuntu 20.04
  • Command you ran: nodemon -C some-script.js

Expected behaviour

some-script.js not being executed on startup. Please correct me if this is a misunderstanding on my part!

Actual behaviour

some-script.js is executed on startup.

Steps to reproduce

  1. Install nodemon.
  2. Create any sort of script, for example something that simply logs "Hello!" to the console.
  3. Run nodemon -C script-name-here.js.

Details
[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
--------------
node: v12.17.0
nodemon: 2.0.4
command: /home/johannes/.local/bin/node /home/johannes/dev/project/node_modules/nodemon/bin/nodemon.js -C --dump some-script.js
cwd: /home/johannes/dev/project
OS: linux x64
--------------
{
  run: false,
  system: { cwd: '/home/johannes/dev/project' },
  required: false,
  dirs: [ '/home/johannes/dev/project' ],
  timeout: 1000,
  options: {
    runOnChangeOnly: true,
    dump: true,
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    watch: [ '*.*', re: /.*\..*/ ],
    monitor: [
      '*.*',
      '!**/.git/**',
      '!**/.nyc_output/**',
      '!**/.sass-cache/**',
      '!**/bower_components/**',
      '!**/coverage/**',
      '!**/node_modules/**'
    ],
    ignoreRoot: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**'
    ],
    restartable: 'rs',
    colours: true,
    execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
    stdin: true,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'some-script.js',
      exec: 'node',
      args: [],
      scriptPosition: 0,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'js,mjs,json',
      env: {}
    }
  },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node', args: [ 'some-script.js' ] },
    string: 'node some-script.js'
  }
}
--------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed bugstaleno activity for 2 weeks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions