Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/utils/git.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { resolve } from "path";
import { spawnAsync } from "./spawn.js";
import { exec as nodeExec } from "node:child_process";
import { resolve } from "node:path";
import { promisify } from "node:util";

const cwd = process.cwd();
const exec = promisify(nodeExec);

/**
* Converts relative paths (relative to current working directory) to absolute
Expand Down Expand Up @@ -80,7 +82,8 @@ function parseGitOutput(str, timeStampMarker = "TS:") {
export async function getRepoGitCommitDateMap() {
let output;
try {
output = await spawnAsync("git", ["log", "--format=TS:%at", "--name-only"]);
const { stdout } = await exec("git log --format=TS:%at --name-only");
output = stdout.toString();
} catch (e) {
console.log(e);
throw new Error("Failed to run 'git log'");
Expand Down
28 changes: 0 additions & 28 deletions src/utils/spawn.js

This file was deleted.