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

ENOENT whenever trying to git.clone into a folder that still doesn't exist #95

Closed
fernandofleury opened this issue Oct 1, 2015 · 7 comments

Comments

@fernandofleury
Copy link

So, I am using exec to clone a repo and place it on a specific folder (in this case is folder1/2/3/4/5 inside of the project), and it works just fine.

But, whenever i try to achiev the same using git.clone, i get ENOENT error. The task is:

git.clone(repo, {
cwd: '1/2/3/4/5'
}, cb);

Honestly I'm not sure if I'm doing this the right way, but the docs aren't so clear about this.

@stephenlacy
Copy link
Owner

Can you confirm that the folder structure and repo name are correct?

Can you also show your exec function?

@fernandofleury
Copy link
Author

gulp.task('install', function(cb) {
return exec('git clone repo.git dest', function(err, stdin, stdout) {
    if (err) {
      console.log(err);
    }
    cb();
  });
});

yeah, the folder structure is used as a paths object. I was using previously on the exec task as well.

@stephenlacy
Copy link
Owner

Did you add the cwd to the raw exec function?
I'm trying to find the similarities, which might cause the issues.

@fernandofleury
Copy link
Author

the cwd is represented as the dest on the snippet

@fernandofleury
Copy link
Author

basically im doing git clone repo 1/2/3/4/5, just as the same as the git.clone() example

@stephenlacy
Copy link
Owner

The cwd is the node working directory, not the destination folder for the git command.
It is failing with ENOENT resource not found since the folder does not exist for it to change directories to.

Add the destination to the args option, git.clone(repo, {args: '1/2/3/4/5'}).

I will add the example to the repo for sub folders, thanks for bringing it up!

@fernandofleury
Copy link
Author

Thank you, Sorry for my miscomprehension.

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

No branches or pull requests

2 participants