steedos-platform/.scripts/.git_push.js
2021-02-01 16:46:37 +08:00

16 lines
519 B
JavaScript

const { execSync } = require('child_process');
const path = require('path');
const _ = require('underscore');
const fs = require('fs');
let appsPath = path.join(process.cwd(), 'apps')
let apps = fs.readdirSync(appsPath);
let versionInfo = require('../lerna.json');
_.each(apps, function(item){
let fPath = path.join(appsPath, item);
let stat = fs.statSync(fPath);
if(stat.isDirectory() === true) {
execSync(`cd ${fPath} && git add . && git commit -m v${versionInfo.version} && git push`);
}
})