Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API]Fix /meta #27

Merged
merged 2 commits into from
Jan 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
npm-debug.log
*.pem
run.bat
api-docs.json
7 changes: 4 additions & 3 deletions src/api/endpoints/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/**
* Module dependencies
*/
import Git from 'nodegit';
import prominence from 'prominence';
import git from 'git-last-commit';

/**
* Show core info
Expand All @@ -14,11 +15,11 @@ import Git from 'nodegit';
module.exports = (params) =>
new Promise(async (res, rej) =>
{
const repository = await Git.Repository.open(__dirname + '/../../');
const commit = await prominence(git).getLastCommit();

res({
maintainer: config.maintainer,
commit: (await repository.getHeadCommit()).sha(),
commit: commit.shortHash,
secure: config.https.enable
});
});