diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 190d8be..4ffda72 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,38 +1,24 @@ --- -import childProcess from "child_process"; -const hash = childProcess - .execSync("git rev-parse --short HEAD") - .toString() - .trim(); +import { GITHUB_URL } from "@/consts"; +import { exec } from "child_process"; +import { promisify } from "util"; + +const execAsync = promisify(exec); +const [shortHash, longHash] = ( + await Promise.all([ + execAsync("git rev-parse --short HEAD"), + execAsync("git rev-parse HEAD"), + ]) +).map(({ stdout }) => stdout.trim()); import { version } from "@/../package.json"; --- -