Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit aea69d3

Browse files
dryajovdaviddias
authored andcommitted
fix: match error if repo doesnt exist (#1262)
1 parent a32dce7 commit aea69d3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/components/repo.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ module.exports = function repo (self) {
1919
version: promisify((callback) => {
2020
self._repo._isInitialized(err => {
2121
if (err) {
22-
if (/ENOENT|not yet initialized/.test(err.message)) {
22+
// TODO: (dryajov) This is really hacky, there must be a better way
23+
const match = [
24+
/Key not found in database \[\/version\]/,
25+
/ENOENT/,
26+
/not yet initialized/
27+
].some((m) => {
28+
return m.test(err.message)
29+
})
30+
if (match) {
2331
// this repo has not been initialized
2432
return callback(null, repoVersion)
2533
}

0 commit comments

Comments
 (0)