ElectricMoose

joined 1 year ago
[–] ElectricMoose@lemmy.world 3 points 1 month ago* (last edited 1 month ago)

Allow me to retort with an all-in-one self build script, along with pass-through args and exitcode.

#!/bin/sh
out=$(mktemp)
sed -e '0,/^#SELFBUILD$/d' "$0" | rustc --o "$out" - && "$out" "$@"
status=$?
rm -f "$out"
exit "$status"
#SELFBUILD

fn main() {
    dbg!(std::env::args());
    println!("hello rust");
    std::process::exit(2);
}

P.S. I have no idea why you'd want that, as it's a terribly inefficient way to ship code, but it's a fascinating glimpse at how we used to do self-extract archives decades ago.

[–] ElectricMoose@lemmy.world 71 points 9 months ago (1 children)

Hacker: That's ok, we don't want you to paste stuff in there, we just want you to send us your cookies. It's not like you're eating them anyway…