mirror of
https://github.com/pomber/git-history.git
synced 2024-08-16 09:50:32 +03:00
Fix paths without directories
This commit is contained in:
parent
e803429650
commit
da993e17b2
@ -1,4 +1,5 @@
|
||||
const execa = require("execa");
|
||||
const pather = require("path");
|
||||
|
||||
async function getCommits(path) {
|
||||
const format = `{"hash":"%h","author":{"login":"%aN"},"date":"%ad"},`;
|
||||
@ -36,7 +37,11 @@ async function getCommits(path) {
|
||||
}
|
||||
|
||||
async function getContent(commit, path) {
|
||||
const { stdout } = await execa("git", ["show", `${commit.hash}:${path}`]);
|
||||
const { stdout } = await execa(
|
||||
"git",
|
||||
["show", `${commit.hash}:./${pather.basename(path)}`],
|
||||
{ cwd: pather.dirname(path) }
|
||||
);
|
||||
return stdout;
|
||||
}
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
- fix `./cli$ git-file-history server.js`
|
Loading…
Reference in New Issue
Block a user