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

error Error: ENOENT, open '~/.git-stats' #2

Closed
ionelmc opened this issue Feb 9, 2015 · 5 comments · Fixed by #5
Closed

error Error: ENOENT, open '~/.git-stats' #2

ionelmc opened this issue Feb 9, 2015 · 5 comments · Fixed by #5
Assignees
Labels

Comments

@ionelmc
Copy link

ionelmc commented Feb 9, 2015

I get this when running git-stats:

error Error: ENOENT, open '/home/ionel/.git-stats'

Seems it doesn't create this file. What's going on here?

Details

$ node --version
v0.10.33
@ionelmc ionelmc changed the title error Error: ENOENT, open '/home/ionel/.git-stats' error Error: ENOENT, open '~/.git-stats' Feb 9, 2015
@IonicaBizau
Copy link
Owner

Yeah, that's an bug...

We should check here if the file doesn't exists:

if (err) { return callback(err); }

If so, it should be created:

if (err && err.code === "ENOENT") {
   return GitStats.save({}, function (err) {
       callback(err, {});
   });
}

I'd appreciate a pull request with this change! Thanks! 😄

In the meantime you can fix it quickly by running echo '{}' > ~/.git-stas.

@IonicaBizau IonicaBizau added the bug label Feb 9, 2015
@ionelmc
Copy link
Author

ionelmc commented Feb 9, 2015

Ah yeah, I did that then I realized I need to override the git commit command in my shell.

Any way to import the history? (I don't use the git commit command anyway).

@IonicaBizau
Copy link
Owner

@atuttle
Copy link

atuttle commented Feb 9, 2015

npm docs git-stats-importer (it's kind of buried in the readme, took me a while to find it too)

@IonicaBizau
Copy link
Owner

@atuttle +1 for npm docs, something that I was looking for! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants