Skip to content

Commit e3978c5

Browse files
echopointgabrielcsapo
authored andcommitted
adds helpful message to the example instead of printing 'undefined' (#23)
1 parent d9d5e9f commit e3978c5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

example/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ git.listen(port, (error) => {
3030
if(error) return console.error(`failed to start git-server because of error ${error}`); // eslint-disable-line
3131
console.log(`node-git-server running at http://localhost:${port}`); // eslint-disable-line
3232
git.list((err, result) => {
33-
console.log(result); // eslint-disable-line
33+
if (!result) {
34+
console.log("No repositories available..."); // eslint-disable-line
35+
} else {
36+
console.log(result); // eslint-disable-line
37+
}
3438
});
3539
});

0 commit comments

Comments
 (0)