node-git-server
node-git-server copied to clipboard
Extra folder created
I have code to loop and create multiple repos in the repo/ directory as shown. It does this all correctly but also creates an empty folder in my main project directory. I can confirm that the repos.create() method is the problem because when I comment it out, the extra folder is not created.
https://user-images.githubusercontent.com/32916949/235507071-5f2de60b-9f26-4a8f-bca2-0eddb506184b.mp4
The problem seems to be here in git.ts
if (typeof callback !== 'function')
callback = () => {
return;
};
if (!/\.git$/.test(repo)) repo += '.git';
const exists = this.exists(repo);
if (!exists) {
this.mkdir(repo);
}
next(this);
The this.mkdir is creating the folder in the wrong directory