fastlane-plugin-s3 icon indicating copy to clipboard operation
fastlane-plugin-s3 copied to clipboard

Sh action adding a backslash to redirect '>' character

Open matthewweldon opened this issue 5 years ago • 1 comments

I have a sh action like this in my fastfile:

sh("echo", someString, ">", "Output.txt")

This action is intended to take a string and put it in Output.txt, which is used by other processes.

However The output in terminal from running the lane shows a backslash is getting added to the command:

 -------------------------------------
[13:59:49]: --- Step: echo someString \> Output.txt ---
[13:59:49]: -------------------------------------
[13:59:49]: $ echo someString \> Output.txt
[13:59:49]: ▸ someString > Output.txt

The backslash is getting put into the echo command escaped and is not being used to redirect the Output.txt file, so the out

I feel like I'm missing something obvious, any help is appreciated, I've tried digging into the gem that generates the bash command but I couldn't track down the culprit

matthewweldon avatar Jul 02 '19 18:07 matthewweldon

I had the same problem w/ circleci/android:api-29-node image and this solved the issue for me.

sh("echo", someString, ">", "Output.txt") #before
sh "echo " +  someString + " > Output.txt" #after

realnumber avatar Oct 30 '20 07:10 realnumber