0.1.4 • Published 8 years ago

grunt-file-missing v0.1.4

Weekly downloads
5
License
-
Repository
github
Last release
8 years ago

grunt-file-missing

Check files and folders for existence.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-file-missing --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-file-missing');

FileMissing task

Run this task with the grunt fileMissing command.

Examples

Will fail if either or both are missing:

fileMissing: {
  scripts: {
    options{
      files: ['a.js', 'b.js']
    }
  }
},

Will not fail, instead, if one or more files missing, will run missing callback function for each missing file, otherwise will run exists callback function for files array:

fileMissing: {
	test_fixtures: {
    options{
      files: ['test/fixtures/*.txt'],
      missing: function(file){ console.log(file, 'is missing!'); },
      exists: function(files){ console.log('All these files exist:', files); }
    }
  }
},