#!/bin/sh global FILES := $ifsjoin(Argv) make $FILES > /dev/null test $Argc -eq 0 && global FILES := 'toybox' # TODO symlinks if just use toybox mkdir -p /out/bin mv $FILES /out/bin printf "FROM scratch\nCOPY bin/ bin/\n" > /out/Dockerfile cd /out tar cf - . (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:FILES) op:Equal rhs:{($ VSub_At "$@")} spids:[4])] spids: [4] ) (SimpleCommand words: [{(make)} {($ VSub_Name "$FILES")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[11])] ) (AndOr children: [ (C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-eq)} {(0)} {(Lit_Other "]")}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:FILES) op:Equal rhs:{(toybox)} spids:[27])] spids: [27] ) ] op_id: Op_DAmp ) (C {(mkdir)} {(-p)} {(/out/bin)}) (C {(mv)} {($ VSub_Name "$FILES")} {(/out/bin)}) (SimpleCommand words: [ {(printf)} { (DQ ("FROM scratch") (EscapedLiteralPart token:) ("COPY bin/ bin/") (EscapedLiteralPart token:) ) } ] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/out/Dockerfile)} spids:[54])] ) (C {(cd)} {(/out)}) (C {(tar)} {(cf)} {(-)} {(.)}) ] )