Files
2022-05-17 02:18:12 +03:00

15 lines
403 B
TypeScript

import { execSync } from 'child_process';
/**
* Executes commands and commits changes with the message provided.
* @param commands Commands to be executed
* @param msg Commit message.
*/
export const execCommandsAndCommit = (commands: string[], msg: string) => {
const cmds = commands.slice();
cmds.push(`git commit -m "${msg}"`);
execSync(cmds.join(' && '), {
stdio: [0, 1, 2],
});
};