@type {() => Promise }
()
| 58 | |
| 59 | /** @type {() => Promise<string>} */ |
| 60 | async function currentHash() { |
| 61 | return await new Promise((resolve) => { |
| 62 | exec("git rev-parse --short=8 HEAD", (error, stdout) => { |
| 63 | const commitHash = stdout.trim(); |
| 64 | |
| 65 | if (error || commitHash === "") { |
| 66 | resolve("unknown"); |
| 67 | } else { |
| 68 | resolve(commitHash); |
| 69 | } |
| 70 | }); |
| 71 | }); |
| 72 | } |
| 73 | |
| 74 | /** @type {() => Promise<void>} */ |
| 75 | async function writeHash() { |