From 0b6b83eb42e95b134a70b7a475df34efcf42fc2f Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 10 Mar 2024 01:17:35 -0600 Subject: [PATCH] overengineering: async git rev-parse execution also converted to tailwind, removed the useless stuff --- src/components/Footer.astro | 46 +++++++++++++------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) 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"; --- -