1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-11-27 22:38:10 +02:00

adding git commit hash and built time to release package.json and showing it at admin

This commit is contained in:
Patrik J. Braun
2019-12-24 00:25:39 +01:00
parent 97c8f41fa3
commit d38d0f01bf
5 changed files with 32 additions and 4 deletions

View File

@@ -117,7 +117,9 @@ gulp.task('copy-package', function () {
devDependencies: { [key: string]: string },
scripts: { [key: string]: string },
dependencies: { [key: string]: string },
optionalDependencies: { [key: string]: string }
optionalDependencies: { [key: string]: string },
buildTime: string,
buildCommitHash: string
}) => {
delete json.devDependencies;
json.scripts = {start: 'node ./src/backend/index.js'};
@@ -139,6 +141,13 @@ gulp.task('copy-package', function () {
}
delete json.optionalDependencies;
}
json.buildTime = (new Date()).toISOString();
try {
json.buildCommitHash = require('child_process').execSync('git rev-parse HEAD');
} catch (e) {
}
return json;
}))
.pipe(gulp.dest('./release'));