This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 3 files changed +13
-4
lines changed
3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ module.exports = {
42
42
} )
43
43
44
44
const withCommit = all || commit
45
- const parsedVersion = `${ data . version } ${ withCommit ? `-${ data . commit } ` : '' } `
45
+ const parsedVersion = `${ data . version } ${ withCommit && data . commit ? `-${ data . commit } ` : '' } `
46
46
47
47
if ( repo ) {
48
48
// go-ipfs prints only the number, even without the --number flag.
@@ -51,9 +51,15 @@ module.exports = {
51
51
print ( parsedVersion )
52
52
} else if ( all ) {
53
53
print ( `js-ipfs version: ${ parsedVersion } ` )
54
+ print ( `interface-ipfs-core version: ${ data [ 'interface-ipfs-core' ] } ` )
55
+ print ( `ipfs-http-client version: ${ data [ 'ipfs-http-client' ] } ` )
54
56
print ( `Repo version: ${ data . repo } ` )
55
57
print ( `System version: ${ os . arch ( ) } /${ os . platform ( ) } ` )
56
58
print ( `Node.js version: ${ process . version } ` )
59
+
60
+ if ( data . commit ) {
61
+ print ( `Commit: ${ data . commit } ` )
62
+ }
57
63
} else {
58
64
print ( `js-ipfs version: ${ parsedVersion } ` )
59
65
}
Original file line number Diff line number Diff line change 3
3
const pkg = require ( '../../../package.json' )
4
4
const { withTimeoutOption } = require ( '../utils' )
5
5
6
- // TODO add the commit hash of the current ipfs version to the response.
7
6
module . exports = ( { repo } ) => {
8
7
return withTimeoutOption ( async function version ( options ) {
9
8
const repoVersion = await repo . version . get ( options )
10
9
11
10
return {
12
11
version : pkg . version ,
13
12
repo : repoVersion ,
14
- commit : ''
13
+ commit : pkg . gitHead || '' , // is defined in published versions,
14
+ 'interface-ipfs-core' : pkg . devDependencies [ 'interface-ipfs-core' ] ,
15
+ 'ipfs-http-client' : pkg . dependencies [ 'ipfs-http-client' ]
15
16
}
16
17
} )
17
18
}
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ module.exports = {
37
37
return h . response ( {
38
38
Version : version . version ,
39
39
Commit : version . commit ,
40
- Repo : version . repo
40
+ Repo : version . repo ,
41
+ 'ipfs-http-client' : version [ 'ipfs-http-client' ] ,
42
+ 'interface-ipfs-core' : version [ 'interface-ipfs-core' ]
41
43
} )
42
44
}
43
45
}
You can’t perform that action at this time.
0 commit comments