Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--report-directory" flag ignored by grunt-cli@~1.4.2 #152

Open
roguib opened this issue Nov 20, 2023 · 0 comments
Open

"--report-directory" flag ignored by grunt-cli@~1.4.2 #152

roguib opened this issue Nov 20, 2023 · 0 comments

Comments

@roguib
Copy link

roguib commented Nov 20, 2023

Hi,
I'm trying to upgrade grunt@1.0.1 to a higher version of the library and I'm facing some troubles with grunt recognising the flag report-directory. To debug this issue I've used this simple grunt task, that prints all the flags that are being passed:

'use strict';

module.exports = (grunt) => {
    grunt.registerTask('grunt_options', 'Runs grunt options debugging', function run() {
        console.log('Those are all the grunt options: ', grunt.option.flags());
    });
};

With some trial and error, I've been able to track down where this regression seems to have happened:

  1. Run npm i grunt@1.3.0 --save-dev
  2. Execute grunt task node/node node_modules/.bin/grunt grunt_options --report-directory=1 --report-dy=2 --report-wd-directory=3
  3. Uninstall grunt@1.3.0 and install 1.4.0 npm uninstall grunt && npm i grunt@1.4.0
  4. Run the task in step 2

For grunt@1.3.0 the output of the task is:

Those are all the grunt options:  [
  '--report-directory=1',
  '--report-dy=2',
  '--report-wd-directory=3',
  '--gruntfile=/Users/roguib/dev/visual-builder/mcs_buf/breeze/vbcs-client/Gruntfile.js'
]

However, for grunt@1.4.0 the output no longer includes --report-directory flag:

Running "grunt_options" task
Those are all the grunt options:  [
  '--report-dy=2',
  '--report-wd-directory=3',
  '--no-respawning',
  '--gruntfile=/Users/roguib/dev/visual-builder/mcs_buf/breeze/vbcs-client/Gruntfile.js'
]

I've noticed by looking at the diff v1.3.0...v1.4.0 it could be caused by a regression in grunt-cli library. Adding an override to grunt-cli to ~1.3.2 instead of the ~1.4.2 version that comes with the new release seems to solve the issue:

"overrides": {
    "grunt": {
      "grunt-cli": "~1.3.2"
    }
  },

In that case, the task correctly identifies --report-directory flag:

Those are all the grunt options:  [
  '--report-directory=1',
  '--report-dy=2',
  '--report-wd-directory=3',
  '--gruntfile=/Users/roguib/dev/visual-builder/mcs_buf/breeze/vbcs-client/Gruntfile.js'
]

This problem is also reproducible with the latest release of grunt@1.6.0 and grunt-cli@~1.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant