瀏覽代碼

Removed command alias. Added parameter check. Updated function documentation.

Maksymilian Barnaś 9 年之前
父節點
當前提交
201e9c0f5e
共有 1 個文件被更改,包括 8 次插入7 次删除
  1. 8 7
      dev/tasks/exec/tasks.js

+ 8 - 7
dev/tasks/exec/tasks.js

@@ -29,16 +29,17 @@ module.exports = ( config ) => {
 		execOnRepositories() {
 			// Omit `gulp exec` part of arguments
 			const options = minimist( process.argv.slice( 3 ), {
-				alias: { t: 'task' },
-				stopEarly: false
+				stopEarly: false,
 			} );
-
 			let execTask;
 
 			try {
-				execTask = require( `./functions/${ options.task }` );
-			}
-			catch ( error ) {
+				if ( options.task ) {
+					execTask = require( `./functions/${ options.task }` );
+				} else {
+					throw new Error( 'Missing task parameter: --task task-name' );
+				}
+			} catch ( error ) {
 				log.err( error );
 			}
 
@@ -60,7 +61,7 @@ module.exports = ( config ) => {
  * @param {String} ckeditor5Path Path to main CKEditor5 repository.
  * @param {Object} packageJSON Parsed package.json file from CKEditor5 repository.
  * @param {String} workspaceRoot Relative path to workspace root.
- * @param {Boolean} dryRun
+ * @param {Object} params Parameters provided to the task via command-line.
  */
 function exec( execTask, ckeditor5Path, packageJSON, workspaceRoot, params ) {
 	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );