forked from LiskArchive/lisk-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest commit info reachable through API
After call to /api/peers/version return build info if lisk was installed from binaries or last commit if installed using source. closes LiskArchive#340
- Loading branch information
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
var childProcess = require('child_process'); | ||
|
||
/** | ||
@throws Will throw an error if the git is not installed or not a git repository. | ||
*/ | ||
function getLastCommit() { | ||
return childProcess.execSync('git rev-parse HEAD').toString().trim(); | ||
} | ||
|
||
module.exports = { | ||
getLastCommit: getLastCommit | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters