Skip to content

Have to manually change current working directory #24

Open
@epsil

Description

@epsil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions