diff options
| author | tusooa <tusooa@kazv.moe> | 2023-10-04 09:31:14 +0000 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2023-10-04 09:31:14 +0000 |
| commit | d35684144126c5af067e43ebf18282ded12f15a6 (patch) | |
| tree | 18e24269009b38c05b66afa9414a7c11c6f2ddbf | |
| parent | 1d679b59a07444e18f24167cb7e8563c5e385d9f (diff) | |
| parent | c05b1b90726e0b47b6e80f0bfe4d880f2f45fa2e (diff) | |
Merge branch 'export-subst-hash' into 'develop'
Use export-subst gitattribute to allow tarball builds
See merge request pleroma/pleroma-fe!1854
| -rw-r--r-- | .gitattributes | 1 | ||||
| -rw-r--r-- | build/webpack.prod.conf.js | 13 | ||||
| -rw-r--r-- | changelog.d/export-subst-hash.fix | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..c5b9ea10 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/build/webpack.prod.conf.js export-subst diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 7de93721..7a108f68 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -11,9 +11,16 @@ var env = process.env.NODE_ENV === 'testing' ? require('../config/test.env') : config.build.env -let commitHash = require('child_process') - .execSync('git rev-parse --short HEAD') - .toString(); +let commitHash = (() => { + const subst = "$Format:%h$"; + if(!subst.match(/Format:/)) { + return subst; + } else { + return require('child_process') + .execSync('git rev-parse --short HEAD') + .toString(); + } +})(); var webpackConfig = merge(baseWebpackConfig, { mode: 'production', diff --git a/changelog.d/export-subst-hash.fix b/changelog.d/export-subst-hash.fix new file mode 100644 index 00000000..fb0d85cb --- /dev/null +++ b/changelog.d/export-subst-hash.fix @@ -0,0 +1 @@ +Use export-subst gitattribute to allow tarball builds |
