This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 5 files changed +11
-8
lines changed
5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ exports.init = require('./init')
12
12
exports . ping = require ( './ping' )
13
13
exports . start = require ( './start' )
14
14
exports . stop = require ( './stop' )
15
+ exports . version = require ( './version' )
15
16
16
17
exports . legacy = { // TODO: these will be removed as the new API is completed
17
18
dag : require ( './dag' ) ,
Original file line number Diff line number Diff line change @@ -302,7 +302,8 @@ function createApi ({
302
302
config : Commands . config ( { repo } ) ,
303
303
id : Commands . id ( { peerInfo } ) ,
304
304
init : ( ) => { throw new AlreadyInitializedError ( ) } ,
305
- start
305
+ start,
306
+ version : Commands . version ( { repo } )
306
307
}
307
308
308
309
return api
Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ function createApi ({
144
144
? Commands . pubsub ( { libp2p } )
145
145
: ( ) => { throw new NotEnabledError ( 'pubsub not enabled' ) } ,
146
146
start : ( ) => apiManager . api ,
147
- stop
147
+ stop,
148
+ version : Commands . version ( { repo } )
148
149
}
149
150
150
151
return api
Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ function createApi ({
102
102
id : Commands . id ( { peerInfo } ) ,
103
103
init : ( ) => { throw new AlreadyInitializedError ( ) } ,
104
104
start,
105
- stop : ( ) => apiManager . api
105
+ stop : ( ) => apiManager . api ,
106
+ version : Commands . version ( { repo } )
106
107
}
107
108
108
109
return api
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const pkg = require ( '../../../package.json' )
4
- const callbackify = require ( 'callbackify' )
5
4
6
5
// TODO add the commit hash of the current ipfs version to the response.
7
- module . exports = function version ( self ) {
8
- return callbackify ( async ( ) => {
9
- const repoVersion = await self . repo . version ( )
6
+ module . exports = ( { repo } ) => {
7
+ return async function version ( ) {
8
+ const repoVersion = await repo . version ( )
10
9
11
10
return {
12
11
version : pkg . version ,
13
12
repo : repoVersion ,
14
13
commit : ''
15
14
}
16
- } )
15
+ }
17
16
}
You can’t perform that action at this time.
0 commit comments