feat: git add multiple files at once

This commit is contained in:
GitHub Actions
2021-10-26 09:41:22 +02:00
parent 5e0ef822fd
commit 4aef61f232
2 changed files with 11 additions and 5 deletions

View File

@@ -60,7 +60,15 @@ class Git {
config = (prop: string, value: string) =>
this.exec(`config ${prop} "${value}"`);
add = (file: string) => this.exec(`add ${file}`);
add = (file: string | string[]) => {
let str = '';
if (Array.isArray(file)) {
file.map((f) => (str += ` ${f}`));
} else {
str = file;
}
return this.exec(`add ${str}`);
};
commit = (message: string) => this.exec(`commit -m "${message}"`);