Files
sausage/host/cred-script/build.nu
T

10 lines
652 B
Nu

#!/usr/bin/env nu
# Rebuild the checked-in credential script component with the pinned guest workspace.
let root = ($env.FILE_PWD | path join ../.. | path expand)
let target = ($env.CARGO_TARGET_DIR? | default ($root | path join target cred-script) | path expand)
with-env {CARGO_BUILD_JOBS: '2', CARGO_TARGET_DIR: $target} {
^cargo build --manifest-path ($env.FILE_PWD | path join Cargo.toml) --target wasm32-wasip2 --release --locked
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'The credential script guest build failed.'} }
}
cp ($target | path join wasm32-wasip2 release sausage-cred-script.wasm) ($env.FILE_PWD | path join script.wasm)