Skip to content

Latest commit

 

History

History
69 lines (54 loc) · 1023 Bytes

README.md

File metadata and controls

69 lines (54 loc) · 1023 Bytes

truffle-watch

A truffle plugin for re-running commands when files change.

Why

When developing contracts, we do a suite of checks regularly whenever we make changes:

  • truffle compile
  • truffle test
  • slither ...

truffle-watch enables you to run all of these checks in a single terminal session.

Installation

1: Install the plugin

$ npm i truffle-watch

2: Add the plugin to truffle.js or truffle-config.js

module.exports = {
  /* ... rest of truffle-config */

  plugins: [
    'truffle-watch'
  ]
}

Usage

Sample usages:

$ truffle run watch
$ truffle run watch --config config.json

Sample config:

{
  'test': {
    'cmd': 'truffle',
    'args': ['test'],
    'files': ['contracts/*.sol', 'test/*.js']
  },
  'slither': {
    'cmd': 'slither',
    'args': ['.'],
    'files': ['contracts/*.sol']
  }
}

Default config:

{
  'test': {
    'cmd': 'truffle',
    'args': ['test'],
    'files': ['contracts/', 'test/']
  }
}