File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This is a deno helper script to locally build the installer using Inno Setup
2
+ // Yeah, I know it's not Node, but we need to compile this and Node SEAs on Win32 are a PITA.
3
+ const content = await Deno . readTextFile ( './nvm.iss' )
4
+ const data = JSON . parse ( await Deno . readTextFile ( './src/manifest.json' ) )
5
+ const { version} = data
6
+ const output = content . replaceAll ( '{{VERSION}}' , version )
7
+ await Deno . writeTextFile ( './.tmp.iss' , output )
8
+
9
+ console . log ( 'Viewing /.tmp.iss' )
10
+ output . split ( "\n" ) . forEach ( ( line , num ) => {
11
+ let n = `${ num + 1 } `
12
+ while ( n . length < 3 ) {
13
+ n = ' ' + n
14
+ }
15
+
16
+ console . log ( `${ n } | ${ line } ` )
17
+ } )
18
+
19
+ const command = await new Deno . Command ( '.\\assets\\buildtools\\iscc.exe' , {
20
+ args : [ '.\\.tmp.iss' ] ,
21
+ stdout : 'piped' ,
22
+ stderr : 'piped' ,
23
+ } )
24
+
25
+ const process = command . spawn ( ) ;
26
+
27
+ // Stream stdout
28
+ ( async ( ) => {
29
+ const decoder = new TextDecoder ( ) ;
30
+ for await ( const chunk of process . stdout ) {
31
+ console . log ( decoder . decode ( chunk ) ) ;
32
+ }
33
+ } ) ( ) ;
34
+
35
+ // Stream stderr
36
+ ( async ( ) => {
37
+ const decoder = new TextDecoder ( ) ;
38
+ for await ( const chunk of process . stderr ) {
39
+ console . error ( decoder . decode ( chunk ) ) ;
40
+ }
41
+ } ) ( ) ;
42
+
43
+ // Wait for completion
44
+ const status = await process . status ;
45
+ Deno . remove ( '.\\.tmp.iss' ) ;
46
+ if ( ! status . success ) {
47
+ Deno . exit ( status . code ) ;
48
+ }
You can’t perform that action at this time.
0 commit comments