@@ -3,10 +3,12 @@ import { app } from 'electron';
3
3
4
4
import { getArch } from './arch' ;
5
5
import { getPlatform } from './platform' ;
6
+ import { getInstalledPodmanVersion } from './podman/install/install' ;
6
7
import { getOperatingSystemInfo } from './systemInfo.js' ;
7
8
8
9
export default async function getDebugInfo ( ) {
9
10
let niceNodeVersion = app . getVersion ( ) ;
11
+ const podmanVersion = await getInstalledPodmanVersion ( ) ;
10
12
11
13
if ( process . env . NODE_ENV === 'development' ) {
12
14
niceNodeVersion = `Dev-${ niceNodeVersion } ` ;
@@ -23,12 +25,14 @@ export default async function getDebugInfo() {
23
25
arch : getArch ( ) ,
24
26
freeMemory : os . freemem ( ) ,
25
27
totalMemory : os . totalmem ( ) ,
28
+ podmanVersion,
26
29
niceNodeVersion,
27
30
} ;
28
31
}
29
32
30
33
const getDebugInfoShort = async ( ) => {
31
34
let niceNodeVersion = app . getVersion ( ) ;
35
+ const podmanVersion = await getInstalledPodmanVersion ( ) ;
32
36
33
37
if ( process . env . NODE_ENV === 'development' ) {
34
38
niceNodeVersion = `Dev-${ niceNodeVersion } ` ;
@@ -43,8 +47,8 @@ const getDebugInfoShort = async () => {
43
47
release : release ,
44
48
arch : getArch ( ) ,
45
49
totalMemory : os . totalmem ( ) ,
50
+ podmanVersion,
46
51
niceNodeVersion,
47
- // ethereumNodeVersion: gethBuildNameForPlatformAndArch(),
48
52
} ;
49
53
} ;
50
54
@@ -58,18 +62,24 @@ export const getDebugInfoString = async () => {
58
62
59
63
export const getDebugInfoShortString = async ( ) => {
60
64
try {
61
- return JSON . stringify ( await getDebugInfoShort ( ) , null , 2 ) ;
65
+ const formattedString = JSON . stringify ( await getDebugInfoShort ( ) , null , 2 )
66
+ . replace ( / [ { } " ] / g, '' )
67
+ . replace ( / : / g, ': ' )
68
+ . replace ( / , \n / g, '\n' )
69
+ . replace ( / ( ^ | \n ) \s * \w / g, ( s ) => s . toUpperCase ( ) ) ;
70
+
71
+ return formattedString ;
62
72
} catch ( err ) {
63
73
return 'No system details.' ;
64
74
}
65
75
} ;
66
76
67
77
export const getGithubIssueProblemURL = async ( ) => {
68
78
const url = new URL ( 'https://github.com/NiceNode/nice-node/issues/new' ) ;
79
+ const debugInfo = await getDebugInfoShortString ( ) ;
69
80
url . searchParams . set (
70
81
'body' ,
71
- `Problem description\n-\n<!-- Describe your problem on the next line! Thank you -->\n\n\nFor NiceNode developers\n-\n${ await getDebugInfoShortString ( ) } ` ,
82
+ `Problem description\n-\n<!-- Describe your problem on the next line! Thank you -->\n\n\nFor NiceNode developers\n-\n${ debugInfo } ` ,
72
83
) ;
73
-
74
84
return url . toString ( ) ;
75
85
} ;
0 commit comments