Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 3.09 KB

File metadata and controls

72 lines (49 loc) · 3.09 KB


grunt-check-outdated/tasks/checkoutdated

tasks/checkoutdated.js: grunt-check-outdated


grunt-check-outdated/tasks/checkoutdated.spawnAsync(grunt, config) ⇒ Promise.<Object>

Promisified adapter for grunt.util.spawn.

Wraps the callback-based grunt.util.spawn API into a Promise so it can be consumed via async/await without mixing callback and business logic. The Promise resolves with the spawn result or rejects with the execution error.

Returns: Promise.<Object> - Resolves with the spawn result object provided by Grunt, or rejects with an Error if the process execution fails.

Param Type Description
grunt grunt The Grunt runtime instance providing grunt.util.spawn.
config Object Spawn configuration passed through to grunt.util.spawn.
config.cmd string Executable to run.
config.args Array.<string> Command-line arguments passed to the executable.
config.opts Object Options object forwarded to the spawn call (env, cwd, stdio).


grunt-check-outdated/tasks/checkoutdated.execute(grunt, task, obj)

Return a promise for executing 'node --[node opts] check-outdated --[opts]'

Param Type Description
grunt grunt the runtime 'instance' of grunt.
task grunt.task the current task
obj Object wrapper for options and arguments.


grunt-check-outdated/tasks/checkoutdated.runTask() ⇒ Promise

Run the check-outdated task.

Returns: Promise - ... required by callee to terminate async call (on "then")


grunt-check-outdated/tasks/checkoutdated.registerMultiTask(grunt)

Registers the 'check_outdated' multitask.

Note:

  • Any errors thrown in lower-level functions (e.g., execute, toArgs, spawnAsync) will automatically reject the returned Promise.
  • Rejected Promises are handled by logging the error and calling done(false) to fail the task.*
Param Type
grunt grunt