#!/usr/bin/env nu # Cargo resolves the object path through its config, independently of each crate's directory. def --wrapped main [...args: string] { let include = ($args | any {|arg| $arg == 'sausage-cwd-init' }) let args = ($args | where {|arg| $arg != 'sausage-cwd-init' }) if $include { # Resolve exit symbols before libc's archive selects its success/failure implementation. let prefix = ($args | first 2) let rest = ($args | skip 2) ^wasm-component-ld ...$prefix $env.SAUSAGE_CWD_INIT ...$rest } else { ^wasm-component-ld ...$args } exit $env.LAST_EXIT_CODE }