-
Hello, git-diff :
@printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --diff-algorithm=patience --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md Now i noticed that doing this, after the script execution is a bit cumbersome and i'd rather have the diffing be part of the foundry script, but I simply can't manage to. I tried to essentially execute the whole command via So I tried reducing complexity to sth like
Which yields Is there any way to do what i want to do via foundry? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The string[] memory inputs = new string[](4);
inputs[0] = "sh";
inputs[1] = "-c";
inputs[2] = "printf hello > test.txt";
vm.ffi(inputs); |
Beta Was this translation helpful? Give feedback.
The
> text.txt
is not part of the call to printf, it's a sh builtin: you're executing the commandprintf
with 3 arguments, which fails. Same goes for expansions:$(...)
You would have to wrap the
printf
with ash
/bash
command like so:sh -c "printf hello > test.txt"
: