git-rev icon indicating copy to clipboard operation
git-rev copied to clipboard

Have to manually change current working directory

Open epsil opened this issue 8 years ago • 1 comments

I currently use git-rev as follows:

process.chdir(__dirname)
git.short(function (str) {
  // ...
})

But isn't the first line redundant? In the beginning of git-rev's index.js file, there is this:

exec(cmd, { cwd: __dirname }, function (...) { ... })

So git-rev should automatically take care of changing the current working directory. However, if I simplify my code:

git.short(function (str) {
  // ...
})

Then it doesn't work unless I already am in the correct directory.

epsil avatar Aug 28 '17 08:08 epsil

Hang on. It turns out that the version in my node_modules/ folder (which I got via npm) is really old -- the latest version was published 5 years ago.

Duplicate of #7, then?

epsil avatar Aug 28 '17 11:08 epsil