tasks.js 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const gulp = require( 'gulp' );
  7. const minimist = require( 'minimist' );
  8. const exec = require( './tasks/exec' );
  9. const log = require( './utils/log' );
  10. const gutil = require( 'gulp-util' );
  11. module.exports = ( config ) => {
  12. const ckeditor5Path = process.cwd();
  13. const packageJSON = require( '../../../package.json' );
  14. // Configure logging.
  15. log.configure(
  16. ( msg ) => gutil.log( msg ),
  17. ( msg ) => gutil.log( gutil.colors.red( msg ) )
  18. );
  19. const tasks = {
  20. execOnRepositories() {
  21. const options = minimist( process.argv.slice( 2 ), {
  22. boolean: [ 'dry-run' ],
  23. default: {
  24. 'dry-run': true
  25. }
  26. } );
  27. const installTask = () => {};
  28. return exec( installTask, ckeditor5Path, packageJSON, config.WORKSPACE_DIR, options[ 'dry-run' ] );
  29. },
  30. register() {
  31. gulp.task( 'exec', tasks.execOnRepositories );
  32. }
  33. };
  34. return tasks;
  35. };