@@ -7,44 +7,45 @@ public static async Task UpdateJavaScriptReference(string jsReferenceOutput)
7
7
Directory . Delete ( jsReferenceOutput , true ) ;
8
8
Directory . CreateDirectory ( jsReferenceOutput ) ;
9
9
10
- var workDir = Path . Combine ( AppContext . BaseDirectory , "ref_JS" ) ;
11
- if ( Directory . Exists ( workDir ) ) {
12
- Directory . Delete ( workDir , true ) ;
13
- }
10
+ var workDir = Path . Combine ( Path . GetTempPath ( ) , Guid . NewGuid ( ) . ToString ( ) ) ;
14
11
15
- Directory . CreateDirectory ( workDir ) ;
12
+ try {
13
+ Directory . CreateDirectory ( workDir ) ;
16
14
17
- await Util . StartShellProcess ( "npm" , [ "pack" , "velopack" ] , workDir ) ;
18
- var tarball = Directory . GetFiles ( workDir , "*.tgz" ) . Single ( ) ;
19
- await Util . StartShellProcess ( "tar" , [ "-xzf" , tarball ] , workDir ) ;
15
+ await Util . StartShellProcess ( "npm" , [ "pack" , "velopack" ] , workDir ) ;
16
+ var tarball = Directory . GetFiles ( workDir , "*.tgz" ) . Single ( ) ;
17
+ await Util . StartShellProcess ( "tar" , [ "-xzf" , tarball ] , workDir ) ;
20
18
21
- var packageDir = Path . Combine ( workDir , "package" ) ;
22
- await Util . StartShellProcess ( "npm" , [ "i" , "typedoc" , "typedoc-plugin-markdown" ] , packageDir ) ;
23
- await Util . StartShellProcess (
24
- "npx" ,
25
- [
26
- "typedoc" ,
27
- "--out" ,
28
- Path . GetFullPath ( jsReferenceOutput ) ,
29
- "--plugin" ,
30
- "typedoc-plugin-markdown" ,
31
- "--flattenOutputFiles" ,
32
- "--readme" ,
33
- "none" ,
34
- "--entryFileName" ,
35
- "index" ,
36
- "--hidePageHeader" ,
37
- "--hideBreadcrumbs" ,
38
- "--indexFormat" ,
39
- "table" ,
40
- "--parametersFormat" ,
41
- "table" ,
42
- "--disableSources" ,
43
- "lib/index.d.ts"
44
- ] ,
45
- packageDir ) ;
19
+ var packageDir = Path . Combine ( workDir , "package" ) ;
20
+ await Util . StartShellProcess ( "npm" , [ "i" , "typedoc" , "typedoc-plugin-markdown" ] , packageDir ) ;
21
+ await Util . StartShellProcess (
22
+ "npx" ,
23
+ [
24
+ "typedoc" ,
25
+ "--out" ,
26
+ Path . GetFullPath ( jsReferenceOutput ) ,
27
+ "--plugin" ,
28
+ "typedoc-plugin-markdown" ,
29
+ "--flattenOutputFiles" ,
30
+ "--readme" ,
31
+ "none" ,
32
+ "--entryFileName" ,
33
+ "index" ,
34
+ "--hidePageHeader" ,
35
+ "--hideBreadcrumbs" ,
36
+ "--indexFormat" ,
37
+ "table" ,
38
+ "--parametersFormat" ,
39
+ "table" ,
40
+ "--disableSources" ,
41
+ "lib/index.d.ts"
42
+ ] ,
43
+ packageDir ) ;
46
44
47
- var indexMd = Path . Combine ( jsReferenceOutput , "index.md" ) ;
48
- await Util . SetPageSidebarOverview ( indexMd ) ;
45
+ var indexMd = Path . Combine ( jsReferenceOutput , "index.md" ) ;
46
+ await Util . SetPageSidebarOverview ( indexMd ) ;
47
+ } finally {
48
+ Directory . Delete ( workDir , true ) ;
49
+ }
49
50
}
50
51
}
0 commit comments