This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -16,26 +16,26 @@ module.exports = function repo (self) {
16
16
* @param {function(Error, Number) } [callback]
17
17
* @returns {undefined }
18
18
*/
19
- version : promisify ( ( callback ) => {
20
- self . _repo . _isInitialized ( err => {
21
- if ( err ) {
22
- // TODO: (dryajov) This is really hacky, there must be a better way
23
- const match = [
24
- / K e y n o t f o u n d i n d a t a b a s e \[ \/ v e r s i o n \] / ,
25
- / E N O E N T / ,
26
- / r e p o i s n o t i n i t i a l i z e d y e t /
27
- ] . some ( ( m ) => {
28
- return m . test ( err . message )
29
- } )
30
- if ( match ) {
31
- // this repo has not been initialized
32
- return callback ( null , repoVersion )
33
- }
34
- return callback ( err )
19
+ version : promisify ( async ( callback ) => {
20
+ const err = await self . _repo . _checkInitialized ( )
21
+
22
+ if ( err ) {
23
+ // TODO: (dryajov) This is really hacky, there must be a better way
24
+ const match = [
25
+ / K e y n o t f o u n d i n d a t a b a s e \[ \/ v e r s i o n \] / ,
26
+ / E N O E N T / ,
27
+ / r e p o i s n o t i n i t i a l i z e d y e t /
28
+ ] . some ( ( m ) => {
29
+ return m . test ( err . message )
30
+ } )
31
+ if ( match ) {
32
+ // this repo has not been initialized
33
+ return callback ( null , repoVersion )
35
34
}
35
+ return callback ( err )
36
+ }
36
37
37
- self . _repo . version . get ( callback )
38
- } )
38
+ self . _repo . version . get ( callback )
39
39
} ) ,
40
40
41
41
gc : require ( './pin/gc' ) ( self ) ,
You can’t perform that action at this time.
0 commit comments