@@ -100,7 +100,7 @@ export async function prepareDist(
100100 }
101101 }
102102
103- // Stage typst-gather binary if it exists (built by configure.sh)
103+ // Stage typst-gather binary (built by configure.sh)
104104 // Only stage if the build machine architecture matches the target architecture
105105 // (cross-compilation is not currently supported)
106106 const buildArch = Deno . build . arch === "aarch64" ? "aarch64" : "x86_64" ;
@@ -111,15 +111,17 @@ export async function prepareDist(
111111 "package/typst-gather/target/release" ,
112112 typstGatherBinaryName ,
113113 ) ;
114- if ( existsSync ( typstGatherSrc ) ) {
115- info ( "\nStaging typst-gather binary" ) ;
116- const typstGatherDest = join ( targetDir , config . arch , typstGatherBinaryName ) ;
117- ensureDirSync ( join ( targetDir , config . arch ) ) ;
118- copySync ( typstGatherSrc , typstGatherDest , { overwrite : true } ) ;
119- info ( `Copied ${ typstGatherSrc } to ${ typstGatherDest } ` ) ;
120- } else {
121- info ( "\nNote: typst-gather binary not found, skipping staging" ) ;
114+ if ( ! existsSync ( typstGatherSrc ) ) {
115+ throw new Error (
116+ `typst-gather binary not found at ${ typstGatherSrc } \n` +
117+ "Run ./configure.sh to build it." ,
118+ ) ;
122119 }
120+ info ( "\nStaging typst-gather binary" ) ;
121+ const typstGatherDest = join ( targetDir , config . arch , typstGatherBinaryName ) ;
122+ ensureDirSync ( join ( targetDir , config . arch ) ) ;
123+ copySync ( typstGatherSrc , typstGatherDest , { overwrite : true } ) ;
124+ info ( `Copied ${ typstGatherSrc } to ${ typstGatherDest } ` ) ;
123125 } else {
124126 info ( `\nNote: Skipping typst-gather staging (build arch ${ buildArch } != target arch ${ config . arch } )` ) ;
125127 }
0 commit comments