You've already forked pigallery2
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:
11
gulpfile.ts
11
gulpfile.ts
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user