8
0

dev.js 870 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. var tools = require( './utils/tools' );
  7. var path = require( 'path' );
  8. var ckeditor5Path = process.cwd();
  9. var workspaceAbsolutePath;
  10. module.exports = function( grunt ) {
  11. grunt.registerTask( 'dev', function( target ) {
  12. var options = {
  13. workspaceRoot: '..'
  14. };
  15. // Get workspace root from configuration.
  16. options = this.options( options );
  17. workspaceAbsolutePath = path.join( ckeditor5Path, options.workspaceRoot );
  18. switch ( target ) {
  19. // grunt dev:init
  20. case 'init':
  21. tools.initDevWorkspace( workspaceAbsolutePath, ckeditor5Path, grunt.log.writeln );
  22. break;
  23. // grunt dev:status
  24. case 'status':
  25. tools.getWorkspaceStatus( workspaceAbsolutePath, grunt.log.writeln );
  26. break;
  27. }
  28. } );
  29. };