Closed brandonros closed 5 years ago
const repoExists = await new Promise((resolve, reject) => {
repos.exists(`${name}.git`, resolve);
});
if (repoExists) {
return { status: 400, body: 'repo already exists' };
}
I just did this instead. Maybe refactor that code to not call .exists
but .access
instead?
or at least return some kind of variable to after
(err)
incb
so that the calling function knows whether or not the repo was created?https://github.com/gabrielcsapo/node-git-server/blob/master/lib/git.js#L215