Use export-subst gitattribute to allow tarball builds

For example it would do the following:

    let subst = "d3bf557c";
This commit is contained in:
Haelwenn (lanodan) Monnier 2023-09-10 08:22:28 +02:00
parent 1d679b59a0
commit 6e5c7bf308
3 changed files with 12 additions and 3 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
/build/webpack.prod.conf.js export-subst

View File

@ -11,9 +11,16 @@ var env = process.env.NODE_ENV === 'testing'
? require('../config/test.env') ? require('../config/test.env')
: config.build.env : config.build.env
let commitHash = require('child_process') let commitHash = (() => {
.execSync('git rev-parse --short HEAD') let subst = "$Format:%h$";
.toString(); if(!subst.match(/Format:/)) {
return subst;
} else {
return require('child_process')
.execSync('git rev-parse --short HEAD')
.toString();
}
})();
var webpackConfig = merge(baseWebpackConfig, { var webpackConfig = merge(baseWebpackConfig, {
mode: 'production', mode: 'production',

View File

@ -0,0 +1 @@
Use export-subst gitattribute to allow tarball builds