Skip to content

Commit f55eff6

Browse files
committed
Adding check for repo and title in config in grunt
1 parent e50581e commit f55eff6

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Gruntfile.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,23 @@ grunt.registerTask( "check-versions", function() {
7070
update( done );
7171
});
7272

73-
grunt.registerTask( "cron", [ "update-repo", "check-versions" ]);
73+
grunt.registerTask( "check-config", function() {
74+
var done = this.async(),
75+
errors = [];
76+
if ( !config.repo ) {
77+
errors.push( "Missing repo in config.json" );
78+
}
79+
if ( !config.title ) {
80+
errors.push( "Missing title in config.json" );
81+
}
82+
if ( errors.length ) {
83+
grunt.verbose.error();
84+
done( new Error( errors.join(", ") ) );
85+
} else {
86+
done();
87+
}
88+
});
89+
90+
grunt.registerTask( "cron", [ "check-config", "update-repo", "check-versions" ]);
7491

7592
};

0 commit comments

Comments
 (0)