forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Ensure generated files exist (dequelabs#1133)
This PR introduces a new task which ensures, existence of a given set of files. In this case it checks, for `axe.***.js` files for all langs specified. If the build generated files do not exist, a fatal error is thrown. Also, the same files are checked for existence as a part of `prepublishOnly` step. <img width="504" alt="screen shot 2018-09-12 at 08 54 26" src="https://user-images.githubusercontent.com/20978252/45410410-85f44680-b669-11e8-9649-8d02dc4bb3df.png"> Closes issue: - dequelabs#1117 ## Reviewer checks **Required fields, to be filled out by PR reviewer(s)** - [x] Follows the commit message policy, appropriate for next version - [x] Has documentation updated, a DU ticket, or requires no documentation change - [x] Includes new tests, or was unnecessary - [x] Code is reviewed for security by: @WilcoFiers
- Loading branch information
Showing
5 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
grunt.registerMultiTask( | ||
'file-exists', | ||
'Task to ensure existence of generated build assets', | ||
function() { | ||
this.data.forEach(function(f) { | ||
var files = grunt.file.expand({ nonull: true }, f); | ||
files.forEach(function(filepath) { | ||
var exists = grunt.file.exists(filepath); | ||
if (!!exists) { | ||
grunt.log.writeln('File: ' + filepath + ', exists.'); | ||
} else { | ||
grunt.fail.fatal('File: ' + filepath + ', does not exist.'); | ||
} | ||
}); | ||
}); | ||
} | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters