Skip to content

Commit

Permalink
Merge pull request thelounge#516 from thelounge/astorije/fix-git-check
Browse files Browse the repository at this point in the history
Make sure git commit check would not send stderr to the console
  • Loading branch information
maxpoulin64 authored Jul 19, 2016
2 parents 26bed21 + c9489fd commit 2b9e0d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

var _ = require("lodash");
var pkg = require("../package.json");
var bcrypt = require("bcrypt-nodejs");
Expand Down Expand Up @@ -81,9 +83,10 @@ function allRequests(req, res, next) {
}

// Information to populate the About section in UI, either from npm or from git
var gitCommit = null;
try {
var gitCommit = require("child_process")
.execSync("git rev-parse --short HEAD") // Returns hash of current commit
gitCommit = require("child_process")
.execSync("git rev-parse --short HEAD 2> /dev/null") // Returns hash of current commit
.toString()
.trim();
} catch (e) {
Expand Down

0 comments on commit 2b9e0d1

Please sign in to comment.