Skip to content

Commit f1b8519

Browse files
committed
fix: replaces spawn with exec to execute git
Fixes #6
1 parent a0179be commit f1b8519

File tree

2 files changed

+6
-31
lines changed

2 files changed

+6
-31
lines changed

src/utils/git.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { resolve } from "path";
2-
import { spawnAsync } from "./spawn.js";
1+
import { exec as nodeExec } from "node:child_process";
2+
import { resolve } from "node:path";
3+
import { promisify } from "node:util";
34

45
const cwd = process.cwd();
6+
const exec = promisify(nodeExec);
57

68
/**
79
* Converts relative paths (relative to current working directory) to absolute
@@ -80,7 +82,8 @@ function parseGitOutput(str, timeStampMarker = "TS:") {
8082
export async function getRepoGitCommitDateMap() {
8183
let output;
8284
try {
83-
output = await spawnAsync("git", ["log", "--format=TS:%at", "--name-only"]);
85+
const { stdout } = await exec("git log --format=TS:%at --name-only");
86+
output = stdout.toString();
8487
} catch (e) {
8588
console.log(e);
8689
throw new Error("Failed to run 'git log'");

src/utils/spawn.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)