Skip to content

Commit d2cd93e

Browse files
ambroisiequ1ck
authored andcommitted
Don't require git at build time
Allow one to set the package version without relying on `git` being available at build time, or the package to even be in a git repository.
1 parent e3d4ad7 commit d2cd93e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webpack.common.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
2929
const tsConfig = JSON.parse(await readFile("./tsconfig.json"));
3030
const tauriConf = JSON.parse(await readFile("./src-tauri/tauri.conf.json"));
3131

32-
const gitVersion = execaSync("git", ["describe", "--tags", "--dirty", "--always"]);
32+
const gitVersion = process.env.TRGUING_VERSION ?? execaSync("git", ["describe", "--tags", "--dirty", "--always"]).stdout;
3333
const versionInfo = `{
34-
"gitVersion": "${gitVersion.stdout}",
34+
"gitVersion": "${gitVersion}",
3535
"backendVersion": "${tauriConf.version}",
3636
"buildDate": ${Date.now()}
3737
}`;

0 commit comments

Comments
 (0)