mirror of https://github.com/abpframework/abp.git
8 changed files with 67 additions and 71 deletions
@ -1,24 +0,0 @@ |
|||||
const glob = require('glob'); |
|
||||
var path = require('path'); |
|
||||
const childProcess = require('child_process'); |
|
||||
|
|
||||
const check = pkgJsonPath => { |
|
||||
try { |
|
||||
return childProcess.execSync(`ncu "/^@abp.*$/" --packageFile ${pkgJsonPath} -u`).toString(); |
|
||||
} catch (error) { |
|
||||
console.log('exec error: ' + error.message); |
|
||||
process.exit(error.status); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
const folder = process.argv[2] || '.'; |
|
||||
|
|
||||
glob(folder + '/**/package.json', {}, (er, files) => { |
|
||||
files.forEach(file => { |
|
||||
if (file.includes('node_modules')) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
console.log(check(file)); |
|
||||
}); |
|
||||
}); |
|
||||
@ -1,26 +0,0 @@ |
|||||
const glob = require('glob'); |
|
||||
const execa = require('execa'); |
|
||||
|
|
||||
const gulp = gulpfilePath => { |
|
||||
try { |
|
||||
console.log('Running the yarn command... Cwd: ' + gulpfilePath); |
|
||||
execa.sync(`yarn`, ['install'], { cwd: gulpfilePath }); |
|
||||
console.log('Running the gulp command...'); |
|
||||
execa.sync(`yarn`, ['gulp'], { cwd: gulpfilePath, stdio: 'inherit' }); |
|
||||
} catch (error) { |
|
||||
console.log('exec error: ' + error.message); |
|
||||
process.exit(error.status); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
const folder = process.argv[2] || '.'; |
|
||||
|
|
||||
glob(folder + '/**/gulpfile.js', {}, (er, files) => { |
|
||||
files.forEach(file => { |
|
||||
if (file.includes('node_modules') || file.includes('wwwroot')) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
gulp(file.replace('/gulpfile.js', '')); |
|
||||
}); |
|
||||
}); |
|
||||
@ -0,0 +1,50 @@ |
|||||
|
const glob = require('glob'); |
||||
|
var path = require('path'); |
||||
|
const childProcess = require('child_process'); |
||||
|
const execa = require('execa'); |
||||
|
const fse = require('fs-extra'); |
||||
|
|
||||
|
const gulp = (folderPath) => { |
||||
|
if ( |
||||
|
!fse.existsSync(folderPath + 'gulpfile.js') || |
||||
|
!glob.sync(folderPath + '*.csproj').length |
||||
|
) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
try { |
||||
|
execa.sync(`yarn`, ['install'], { cwd: folderPath, stdio: 'inherit' }); |
||||
|
execa.sync(`yarn`, ['gulp'], { cwd: folderPath, stdio: 'inherit' }); |
||||
|
} catch (error) { |
||||
|
console.log('\x1b[31m', 'Error: ' + error.message); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
const updatePackages = (pkgJsonPath) => { |
||||
|
try { |
||||
|
const result = childProcess |
||||
|
.execSync(`ncu "/^@abp.*$/" --packageFile ${pkgJsonPath} -u`) |
||||
|
.toString(); |
||||
|
console.log('\x1b[0m', result); |
||||
|
} catch (error) { |
||||
|
console.log('\x1b[31m', 'Error: ' + error.message); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
console.time(); |
||||
|
glob('../**/package.json', {}, (er, files) => { |
||||
|
files = files.filter( |
||||
|
(f) => |
||||
|
f && |
||||
|
!f.includes('node_modules') && |
||||
|
!f.includes('wwwroot') && |
||||
|
!f.includes('bin') && |
||||
|
!f.includes('obj') |
||||
|
); |
||||
|
|
||||
|
files.forEach((file) => { |
||||
|
updatePackages(file); |
||||
|
gulp(file.replace('package.json', '')); |
||||
|
}); |
||||
|
console.timeEnd(); |
||||
|
}); |
||||
Loading…
Reference in new issue