How to use the @ckeditor/ckeditor5-dev-utils.tools.shExec function in @ckeditor/ckeditor5-dev-utils

To help you get started, we’ve selected a few @ckeditor/ckeditor5-dev-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / transform-commit / getchangedfilesforcommit.js View on Github external
module.exports = function getChangedFilesForCommit( commitId ) {
	const gitCommand = `git log -m -1 --name-only --pretty="format:" ${ commitId }`;
	const changedFiles = tools.shExec( gitCommand, { verbosity: 'error' } ).trim();

	// Merge commits can have two parents. Returned files for merge commits looks like:
	// file1            <-- files from merged branch
	// file2            <-- files from merged branch
	// file             <-- files from merged branch
	//
	// other-file1      <-- files from last commit before merge
	// other-file2      <-- files from last commit before merge
	// We need to filter out files from commit before merge.

	return changedFiles.split( '\n\n' )[ 0 ].split( '\n' );
};
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / tasks / generatesummarychangelog.js View on Github external
currentChangelog = currentChangelog.replace( changelogUtils.changelogHeader, '' );

					// Concat header, new and current changelog.
					let newChangelog = changelogUtils.changelogHeader + changelogEntries + '\n\n\n' + currentChangelog.trim();
					newChangelog = newChangelog.trim() + '\n';

					// Save the changelog.
					changelogUtils.saveChangelog( newChangelog, repositoryPath );

					log.info(
						indent +
						chalk.green( `Changelog for "${ chalk.underline( packageJson.name ) }" (v${ version }) has been generated.` )
					);

					// Commit the new changelog.
					tools.shExec( `git add ${ changelogUtils.changelogFile }`, { verbosity: 'error' } );
					tools.shExec( 'git commit -m "Docs: Changelog. [skip ci]"', { verbosity: 'error' } );

					generatedChangelogMap.set( packageJson.name, version );
				} );
			} )
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / hascommitsfromlastrelease.js View on Github external
module.exports = function hasCommitsFromLastRelease() {
	const shExecParams = { verbosity: 'error' };
	let commitsNumber;

	const tagsList = tools.shExec( 'git tag --list', shExecParams ).trim();

	if ( tagsList.length ) {
		commitsNumber = tools.shExec( 'git log `git describe --tags --abbrev=0`..HEAD --oneline | wc -l', shExecParams );
	} else {
		// Won't throw an error if repository does not have any commit.
		commitsNumber = tools.shExec( 'git log --oneline 2> /dev/null | wc -l', shExecParams );
	}

	return parseInt( commitsNumber.trim() ) > 0;
};
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-docs / lib / index.js View on Github external
fs.writeFile( tmpConfig.name, JSON.stringify( jsDocConfig ), 'utf8', error => {
					if ( error ) {
						return reject( error );
					}

					const cmd = require.resolve( 'jsdoc/jsdoc.js' );

					console.log( 'JSDoc started...' );

					try {
						tools.shExec( `${ cmd } -c ${ tmpConfig.name }`, { verbosity: 'info' } );
					} catch ( error ) {
						return reject( `Error during JSDoc generation: ${ error.message }` );
					}

					console.log( `Documented ${ files.length } files!` );

					resolve();
				} );
			} ) );
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / versions.js View on Github external
getLastTagFromGit() {
		try {
			const lastTag = tools.shExec( 'git describe --abbrev=0 --tags 2> /dev/null', { verbosity: 'error' } );

			return lastTag.trim().replace( /^v/, '' ) || null;
		} catch ( err ) {
			return null;
		}
	},
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / tasks / releasesubrepositories.js View on Github external
function exec( command ) {
		if ( dryRun ) {
			log.info( `⚠️  ${ chalk.grey( 'Execute:' ) } "${ chalk.cyan( command ) }" in "${ chalk.grey.italic( process.cwd() ) }".` );
		}

		return tools.shExec( command, { verbosity: 'error' } );
	}
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / tasks / releaserepository.js View on Github external
function exec( command ) {
	return tools.shExec( command, { verbosity: 'error' } );
}
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / releaserepository.js View on Github external
function exec( command ) {
	return tools.shExec( command, { verbosity: 'error' } );
}