@@ -49,11 +49,11 @@ struct Bundle: AsyncParsableCommand {
4949 @Option (
5050 name: . long,
5151 help: """
52- Which optimizations to apply to the .wasm binary output.
53- Available values: \(
52+ Which optimizations to apply to the .wasm binary output.
53+ Available values: \(
5454 WasmOptimizations . allCases. map ( \. rawValue) . joined ( separator: " , " )
55- )
56- """
55+ )
56+ """
5757 )
5858 var wasmOptimizations : WasmOptimizations = . size
5959
@@ -122,7 +122,9 @@ struct Bundle: AsyncParsableCommand {
122122 terminal. write ( " Bundle generation finished successfully \n " , inColor: . green, bold: true )
123123 }
124124
125- func optimize( _ inputPath: AbsolutePath , outputPath: AbsolutePath , terminal: InteractiveWriter ) async throws {
125+ func optimize( _ inputPath: AbsolutePath , outputPath: AbsolutePath , terminal: InteractiveWriter )
126+ async throws
127+ {
126128 var wasmOptArgs = [ " wasm-opt " , " -Os " , inputPath. pathString, " -o " , outputPath. pathString]
127129 if debugInfo {
128130 wasmOptArgs. append ( " --debuginfo " )
@@ -156,7 +158,7 @@ struct Bundle: AsyncParsableCommand {
156158 try localFileSystem. move ( from: wasmOutputFilePath, to: mainModulePath)
157159
158160 // Copy the bundle entrypoint, point to the binary, and give it a cachebuster name.
159- let ( _, _, entrypointPath) = dependency. paths ( on: localFileSystem)
161+ let ( _, _, entrypointPath) = try dependency. paths ( on: localFileSystem)
160162 let entrypoint = try ByteString (
161163 encodingAsUTF8: localFileSystem. readFileContents ( entrypointPath)
162164 . description
@@ -173,10 +175,11 @@ struct Bundle: AsyncParsableCommand {
173175
174176 try localFileSystem. writeFileContents (
175177 AbsolutePath ( bundleDirectory, " index.html " ) ,
176- bytes: ByteString ( encodingAsUTF8: HTML . indexPage (
177- customContent: HTML . readCustomIndexPage ( at: customIndexPage, on: localFileSystem) ,
178- entrypointName: entrypointName
179- ) )
178+ bytes: ByteString (
179+ encodingAsUTF8: HTML . indexPage (
180+ customContent: HTML . readCustomIndexPage ( at: customIndexPage, on: localFileSystem) ,
181+ entrypointName: entrypointName
182+ ) )
180183 )
181184
182185 let manifest = try toolchain. manifest. get ( )
0 commit comments