浏览代码

Added linking directories for dev update task.

Szymon Kupś 9 年之前
父节点
当前提交
fa88509acf
共有 2 个文件被更改,包括 13 次插入2 次删除
  1. 11 0
      dev/tasks/dev/tasks/update.js
  2. 2 2
      dev/tasks/dev/utils/tools.js

+ 11 - 0
dev/tasks/dev/tasks/update.js

@@ -9,6 +9,7 @@ const tools = require( '../utils/tools' );
 const git = require( '../utils/git' );
 const git = require( '../utils/git' );
 const path = require( 'path' );
 const path = require( 'path' );
 const log = require( '../utils/log' );
 const log = require( '../utils/log' );
+const installTask = require( './install' );
 
 
 /**
 /**
  * 1. Get CKEditor5 dependencies from package.json file.
  * 1. Get CKEditor5 dependencies from package.json file.
@@ -48,6 +49,16 @@ module.exports = ( ckeditor5Path, packageJSON, workspaceRoot, runNpmUpdate ) =>
 						log.out( `Running "npm update" in ${ urlInfo.name }...` );
 						log.out( `Running "npm update" in ${ urlInfo.name }...` );
 						tools.npmUpdate( repositoryAbsolutePath );
 						tools.npmUpdate( repositoryAbsolutePath );
 					}
 					}
+
+					try {
+						log.out( `Linking ${ repositoryURL }...` );
+						tools.linkDirectories( repositoryAbsolutePath, path.join( ckeditor5Path, 'node_modules', dependency ) );
+					} catch ( error ) {
+						log.err( error );
+					}
+				} else {
+					// Directory does not exits in workspace - install it.
+					installTask( ckeditor5Path, workspaceRoot, repositoryURL );
 				}
 				}
 			}
 			}
 
 

+ 2 - 2
dev/tasks/dev/utils/tools.js

@@ -215,12 +215,12 @@ module.exports = {
 	},
 	},
 
 
 	/**
 	/**
-	 * Calls `npm update` command in specified path.
+	 * Calls `npm update --dev` command in specified path.
 	 *
 	 *
 	 * @param {String} path
 	 * @param {String} path
 	 */
 	 */
 	npmUpdate( path ) {
 	npmUpdate( path ) {
-		this.shExec( `cd ${ path } && npm update` );
+		this.shExec( `cd ${ path } && npm update --dev` );
 	},
 	},
 
 
 	/**
 	/**