Makefile 的 Node.js 版本

976 阅读1分钟

🚧 A minimal alternative for GNU Makefile.

preview

Install

If you have node >= 4.0.0 installed:

Example

An example Runfile

var task = module.exports = {}

task.clean = () => {
  rm('-rf', 'testFolder')
  rm('-rf', 'testSource')
}

// or run external tools
task.deploy = (argv) => {
  var message = argv._[1] || 'update'
  exec('git add -A')
  exec(`git commit -m "${message}"`)
  exec('git push origin master')
}

task.default = ['clean', 'deploy']

then in your favorite terminal:

License

MIT.