mop-cli
Version:
Lint and maintain many projects at once
27 lines (22 loc) • 563 B
JavaScript
const git = require('../git');
const isPushed = async (cwd) => {
try {
await git('fetch', { cwd });
const stdout = await git('cherry', { cwd });
return stdout === '';
}
catch (err) {
if (err.message.includes('Not a git repository')) {
return true;
}
throw err;
}
};
const pushedRepo = async (project) => {
const pushed = await isPushed(project.path);
return pushed || {
message : 'Repository has unpushed changes'
};
};
module.exports = pushedRepo;
;