Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = ( ckeditor5Path, packageJSON, workspaceRoot ) => {
const log = logger();
const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
// Get all CKEditor dependencies from package.json.
const dependencies = workspace.getDependencies( packageJSON.dependencies );
if ( dependencies ) {
const directories = workspace.getDirectories( workspaceAbsolutePath );
if ( directories.length ) {
for ( let dependency in dependencies ) {
const repositoryAbsolutePath = path.join( workspaceAbsolutePath, dependency );
const repositoryURL = dependencies[ dependency ];
// Check if repository's directory exists.
if ( directories.indexOf( dependency ) > -1 ) {
try {
log.info( `Linking ${ repositoryURL }...` );
tools.linkDirectories( repositoryAbsolutePath, path.join( ckeditor5Path, 'node_modules', dependency ) );
} catch ( error ) {
log.error( error );
}
}
}
module.exports = ( ckeditor5Path, packageJSON, workspaceRoot ) => {
const log = logger();
const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
// Get all CKEditor dependencies from package.json.
const dependencies = workspace.getDependencies( packageJSON.dependencies );
if ( dependencies ) {
const directories = workspace.getDirectories( workspaceAbsolutePath );
if ( directories.length ) {
for ( let dependency in dependencies ) {
const repositoryAbsolutePath = path.join( workspaceAbsolutePath, dependency );
let status;
// Check if repository's directory already exists.
if ( directories.indexOf( dependency ) > -1 ) {
try {
status = git.getStatus( repositoryAbsolutePath );
log.info( `${ gutil.colors.cyan( dependency ) }\n${ status.trim() }` );
} catch ( error ) {
log.error( error );
}
}
}
module.exports = ( installTask, ckeditor5Path, packageJSON, workspaceRoot, runNpmUpdate ) => {
const log = logger();
const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
// Fetch main repository
log.info( `Fetching branches from ${ packageJSON.name }...` );
git.fetchAll( ckeditor5Path );
// Get all CKEditor dependencies from package.json.
const dependencies = workspace.getDependencies( packageJSON.dependencies );
if ( dependencies ) {
const directories = workspace.getDirectories( workspaceAbsolutePath );
for ( let dependency in dependencies ) {
const repositoryURL = dependencies[ dependency ];
const urlInfo = git.parseRepositoryUrl( repositoryURL );
const repositoryAbsolutePath = path.join( workspaceAbsolutePath, dependency );
// Check if repository's directory already exists.
if ( directories.indexOf( urlInfo.name ) > -1 ) {
log.info( `Fetching branches from ${ urlInfo.name }...` );
git.fetchAll( repositoryAbsolutePath );
log.info( `Checking out ${ urlInfo.name } to ${ urlInfo.branch }...` );
git.checkout( repositoryAbsolutePath, urlInfo.branch );
log.info( `Pulling changes to ${ urlInfo.name }...` );
git.pull( repositoryAbsolutePath, urlInfo.branch );