Skip to content

Grunt task to kill a process using either a already-known PID or pid file

License

Notifications You must be signed in to change notification settings

brandonramirez/grunt-kill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-kill Build Status

Validate processes from grunt.

Requires grunt 0.4

Install

npm install grunt-kill --save-dev

Add the following to load the task into your Gruntfile:

grunt.loadNpmTasks('grunt-kill');

Configure

grunt-kill is a multi-task, meaning you can create targets with different configurations.

There are 4 ways you can specify the pid to kill:

  • Specify the pid directly with the pid option
  • Give a function with the pid option which returns the pid
  • Point to a pid file with the pid option
  • Use the standard grunt source file settings to specify pid files.

Examples specifying a pidfile in your Gruntfile:

kill: {
  myService: {
    src: [ 'my-service.pid' ]
  },
  secondary: {
    pid: 'secondary.pid'
  }
}

Example specifying a pid directly:

kill: {
  simpleService: {
    pid: 5741
  }
}

Example with a function:

kill: {
  functionCallExample: {
    pid: function () {
      return locateMyService().getPid();
    }
  }
}

Only synchronous functions are supported at this time.

Running Tests

Most of the code in this plugin has unit tests. To run them all to check for regressions, run just grunt, like so:

$ grunt

This will lint all of the JavaScript source files, the Gruntfile itself, and run all unit tests.

Release History

  • 2015-08-23   v1.0.0   First official release

About

Grunt task to kill a process using either a already-known PID or pid file

Resources

License

Stars

Watchers

Forks

Packages

No packages published