@@ -171,13 +171,26 @@ fn download_wasmedge_macos(version: &str) -> std::io::Result<()> {
171
171
// Command 1: Create the destination directory.
172
172
let dest_dir = std:: env:: current_dir ( ) ?. join ( "wasmedge" ) ;
173
173
fs:: create_dir_all ( & dest_dir) ?;
174
-
174
+ #[ cfg( target_arch = "x86_64" ) ]
175
+ let suffix = "x86_64" ;
176
+ #[ cfg( target_arch = "aarch64" ) ]
177
+ let suffix = "arm64" ;
178
+ let ( wasmedge_download_url, wasi_nn_download_url) = (
179
+ format ! (
180
+ "https://github.com/WasmEdge/WasmEdge/releases/download/{}/WasmEdge-{}-darwin_{}.tar.gz" ,
181
+ version, version, suffix
182
+ ) ,
183
+ format ! (
184
+ "https://github.com/WasmEdge/WasmEdge/releases/download/{}/WasmEdge-plugin-wasi_nn-ggml-{}-darwin_{}.tar.gz" ,
185
+ version, version, suffix
186
+ ) ,
187
+ ) ;
175
188
// Command 2: Download and extract WasmEdge.
176
189
{
177
190
println ! ( "Downloading wasmedge v{version} to: {}" , dest_dir. display( ) ) ;
178
191
let curl_script_cmd = Command :: new ( "curl" )
179
192
. arg ( "-sSfL" )
180
- . arg ( "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-darwin_arm64.tar.gz" )
193
+ . arg ( wasmedge_download_url )
181
194
. stdout ( Stdio :: piped ( ) )
182
195
. spawn ( ) ?;
183
196
@@ -209,7 +222,7 @@ fn download_wasmedge_macos(version: &str) -> std::io::Result<()> {
209
222
println ! ( "Downloading wasmedge v{version} WASI-NN plugin to: {}" , plugin_dest_dir. display( ) ) ;
210
223
let curl_script_cmd = Command :: new ( "curl" )
211
224
. arg ( "-sSfL" )
212
- . arg ( "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-plugin-wasi_nn-ggml-0.14.0-darwin_arm64.tar.gz" )
225
+ . arg ( wasi_nn_download_url )
213
226
. stdout ( Stdio :: piped ( ) )
214
227
. spawn ( ) ?;
215
228
0 commit comments