-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixed Indentation breaks Windows shell commands #206
Comments
Actually, I think I'm misunderstanding the |
I'm not sure if I'm understanding this correctly. Couldn't you use |
I don't think so but I'll try it and get back to you. Sorry I didn't explain it very well. If I remember correctly the real problem is that |
I tried Example 1 - No newline:
Output:
Example 2 - Same script except 1 newline in the command string:
Output:
I thought it might be an issue with reading the output, but I tried writing to a file before and after the newline, and it only worked before, so I think indeed the problem is that it only executes commands up to the newline. |
In the above examples I have an
Relevantly, his prints 1 line on windows but 2 on ubuntu, so I'm guessing it's some windows quirk. |
Since for me this is all about running powershell command strings, I found a workaround by setting the environment variable
This seems to fix the newline issue. Perhaps not a workaround for everyone, but so far this is working for me. |
Describe the bug
I've noticed that if I have nested indentation in a
shell
cmd string, even with the YAML>
, the cmd doesn't get its newlines stripped as I would expect. When the string has newlines left within it, when it is run withsub_process
, it seems to execute only the first line of the string. An example:I'm executing with
organize run .\indent_config.yaml --working-dir .
Expected behavior
My understanding of the
>
operator is that it should remove all the newlines. And it does as long as you have uniform indentation for that string block. I can see in the logged output that in the second example the\n
's are left in, while they are removed in the first example. I'm wondering if it might have something to do with this call todedent
.The result is that scripted commands must be single-line, or fully-left indented.
Environment (please complete the following information):
organize --version
: organize, version 2.2.0The text was updated successfully, but these errors were encountered: