8
0
Просмотр исходного кода

Removing installGitHooks method as its no longer needed - hooks are installed during npm install.

Szymon Kupś 10 лет назад
Родитель
Сommit
f539585814

+ 0 - 4
dev/tasks/dev/tasks/dev-install.js

@@ -22,7 +22,6 @@ const path = require( 'path' );
  * 5. If plugin exists in `ckeditor5/node_modules/` - runs `npm uninstall plugin_name`.
  * 6. Links plugin directory into `ckeditor5/node_modules/`.
  * 7. Adds dependency to `ckeditor5/package.json`.
- * 8. Installs Git hooks.
  *
  * @param {String} ckeditor5Path Absolute path to `ckeditor5` repository.
  * @param {String} workspaceRoot Relative path to workspace root directory.
@@ -105,9 +104,6 @@ module.exports = ( ckeditor5Path, workspaceRoot, name, writeln ) => {
 
 			return json;
 		} );
-
-		writeln( `Installing Git hooks in ${ urlInfo.name }...` );
-		tools.installGitHooks( repositoryPath );
 	} else {
 		throw new Error( 'Please provide valid GitHub URL, NPM module name or path.' );
 	}

+ 0 - 9
dev/tasks/dev/utils/tools.js

@@ -188,15 +188,6 @@ module.exports = {
 		this.shExec( `cd ${ path } && npm update` );
 	},
 
-	/**
-	 * Installs Git hooks in specified repository.
-	 *
-	 * @param {String} path
-	 */
-	installGitHooks( path ) {
-		this.shExec( `cd ${ path } && grunt githooks` );
-	},
-
 	/**
 	 * Copies source files/directories into destination directory.
 	 * If directory path is provided in sources array - all files inside that directory will be copied.

+ 0 - 7
dev/tests/dev/dev-install.js

@@ -34,7 +34,6 @@ describe( 'dev-install', () => {
 		spies.getGitUrlFromNpm = sinon.stub( tools, 'getGitUrlFromNpm' );
 		spies.readPackageName = sinon.stub( tools, 'readPackageName' );
 		spies.npmUninstall = sinon.stub( tools, 'npmUninstall' );
-		spies.installGitHooks = sinon.stub( tools, 'installGitHooks' );
 	} );
 
 	afterEach( () => {
@@ -80,9 +79,6 @@ describe( 'dev-install', () => {
 		const json = updateFn( {} );
 		expect( json.dependencies ).to.be.a( 'object' );
 		expect( json.dependencies[ urlInfo.name ] ).to.equal( repositoryUrl );
-
-		sinon.assert.calledOnce( spies.installGitHooks );
-		sinon.assert.calledWithExactly( spies.installGitHooks, repositoryPath );
 	} );
 
 	it( 'should use npm module name', () => {
@@ -123,9 +119,6 @@ describe( 'dev-install', () => {
 		const json = updateFn( {} );
 		expect( json.dependencies ).to.be.a( 'object' );
 		expect( json.dependencies[ urlInfo.name ] ).to.equal( repositoryUrl );
-
-		sinon.assert.calledOnce( spies.installGitHooks );
-		sinon.assert.calledWithExactly( spies.installGitHooks, repositoryPath );
 	} );
 
 	it( 'should use local relative path', () => {

+ 0 - 13
dev/tests/dev/tools.js

@@ -319,19 +319,6 @@ describe( 'utils', () => {
 			} );
 		} );
 
-		describe( 'installGitHooks', () => {
-			it( 'should be defined', () => expect( tools.installGitHooks ).to.be.a( 'function' ) );
-			it( 'should execute grunt githooks command', () => {
-				const shExecStub = sandbox.stub( tools, 'shExec' );
-				const path = '/path/to/repository';
-
-				tools.installGitHooks( path );
-
-				expect( shExecStub.calledOnce ).to.equal( true );
-				expect( shExecStub.firstCall.args[ 0 ] ).to.equal( `cd ${ path } && grunt githooks` );
-			} );
-		} );
-
 		describe( 'copy', () => {
 			it( 'should be defined', () => expect( tools.copy ).to.be.a( 'function' ) );
 			it( 'should copy files', () => {