File tree Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,10 @@ export async function bundle(
29
29
script : string ,
30
30
options ?: Deno . EmitOptions ,
31
31
) : Promise < string > {
32
- const [ shebang , bundledScript ] = await Promise . all ( [
33
- getShebang ( script ) ,
34
- preBundle (
35
- script ,
36
- options ,
37
- ) . then ( ( tmpFile ) => bundleFile ( tmpFile , { check : false } ) ) ,
38
- ] ) ;
39
-
40
- return shebang
41
- . replace ( "#!/usr/bin/env dzx" , "#!/usr/bin/env deno" ) +
42
- bundledScript ;
32
+ return bundleFile ( await preBundle (
33
+ script ,
34
+ options ,
35
+ ) , { check : false } ) ;
43
36
}
44
37
45
38
export async function preBundle (
@@ -76,13 +69,13 @@ async function bundleFile(
76
69
return Object . values ( result . files ) [ 0 ] as string ;
77
70
}
78
71
79
- async function getShebang ( script : string ) : Promise < string > {
80
- let shebang = "" ;
81
- const file = await Deno . open ( script ) ;
82
- const firstLine = await io . readLines ( file ) . next ( ) ;
83
- if ( firstLine . value . startsWith ( "#!" ) ) {
84
- shebang = firstLine . value + "\n" ;
85
- }
86
- file . close ( ) ;
87
- return shebang ;
88
- }
72
+ // async function getShebang(script: string): Promise<string> {
73
+ // let shebang = "";
74
+ // const file = await Deno.open(script);
75
+ // const firstLine = await io.readLines(file).next();
76
+ // if (firstLine.value.startsWith("#!")) {
77
+ // shebang = firstLine.value + "\n";
78
+ // }
79
+ // file.close();
80
+ // return shebang;
81
+ // }
You can’t perform that action at this time.
0 commit comments