1
0
silverbullet/plugs/core/git.ts

13 lines
385 B
TypeScript
Raw Normal View History

2022-03-23 14:41:12 +00:00
import { syscall } from "./lib/syscall";
export async function commit() {
console.log("Snapshotting the current space to git");
await syscall("shell.run", "git", ["add", "./*.md"]);
try {
await syscall("shell.run", "git", ["commit", "-a", "-m", "Snapshot"]);
} catch (e) {
// We can ignore, this happens when there's no changes to commit
}
console.log("Done!");
}