1
1
import { addPath } from "../utils/path/addPath"
2
2
import { setupAptPack } from "../utils/setup/setupAptPack"
3
- import { PackageInfo , setupBin } from "../utils/setup/setupBin"
3
+ import { InstallationInfo , PackageInfo , setupBin } from "../utils/setup/setupBin"
4
4
import { setupBrewPack } from "../utils/setup/setupBrewPack"
5
5
import { setupChocoPack } from "../utils/setup/setupChocoPack"
6
6
import { addBinExtension } from "../utils/extension/extension"
7
- import { extractTarByExe } from "../utils/setup/extract"
7
+ import { extractTar } from "../utils/setup/extract"
8
8
import { warning } from "../utils/io/io"
9
9
10
10
/** Get the platform data for cmake */
@@ -17,9 +17,7 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
17
17
binRelativeDir : "bin/" ,
18
18
binFileName : addBinExtension ( "doxygen" ) ,
19
19
extractedFolderName : folderName ,
20
- extractFunction : ( file : string , dest : string ) => {
21
- return extractTarByExe ( file , dest , [ "--strip-components=1" ] )
22
- } ,
20
+ extractFunction : extractTar ,
23
21
url : `https://www.doxygen.nl/files/${ folderName } .linux.bin.tar.gz` ,
24
22
}
25
23
}
@@ -41,18 +39,21 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
41
39
return { binDir }
42
40
}
43
41
case "darwin" : {
44
- setupBrewPack ( "doxygen" , undefined )
45
- return setupBrewPack ( "graphviz" , undefined )
42
+ const installationInfo = setupBrewPack ( "doxygen" , undefined )
43
+ setupBrewPack ( "graphviz" , undefined )
44
+ return installationInfo
46
45
}
47
46
case "linux" : {
47
+ let installationInfo : InstallationInfo
48
48
try {
49
49
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
50
- await setupBin ( "doxygen" , version , getDoxygenPackageInfo , setupDir , arch )
50
+ installationInfo = await setupBin ( "doxygen" , version , getDoxygenPackageInfo , setupDir , arch )
51
51
} catch ( err ) {
52
52
warning ( `Failed to download doxygen binary. ${ err } . Falling back to apt-get.` )
53
- await setupAptPack ( "doxygen" , undefined )
53
+ installationInfo = await setupAptPack ( "doxygen" , undefined )
54
54
}
55
- return setupAptPack ( "graphviz" , undefined )
55
+ await setupAptPack ( "graphviz" , undefined )
56
+ return installationInfo
56
57
}
57
58
default : {
58
59
throw new Error ( `Unsupported platform` )
0 commit comments