Merge pull request #516 from thelounge/astorije/fix-git-check
Make sure git commit check would not send stderr to the console
This commit is contained in:
commit
412f28aaee
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
var pkg = require("../package.json");
|
var pkg = require("../package.json");
|
||||||
var bcrypt = require("bcrypt-nodejs");
|
var bcrypt = require("bcrypt-nodejs");
|
||||||
@ -81,9 +83,10 @@ function allRequests(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Information to populate the About section in UI, either from npm or from git
|
// Information to populate the About section in UI, either from npm or from git
|
||||||
|
var gitCommit = null;
|
||||||
try {
|
try {
|
||||||
var gitCommit = require("child_process")
|
gitCommit = require("child_process")
|
||||||
.execSync("git rev-parse --short HEAD") // Returns hash of current commit
|
.execSync("git rev-parse --short HEAD 2> /dev/null") // Returns hash of current commit
|
||||||
.toString()
|
.toString()
|
||||||
.trim();
|
.trim();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user