Skip to content
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

Add multi-line support to pre/post_install (fixes #1890) #1980

Merged
merged 2 commits into from
Jan 26, 2018

Conversation

rasa
Copy link
Member

@rasa rasa commented Jan 24, 2018

No description provided.

@rasa
Copy link
Member Author

rasa commented Jan 26, 2018

@r15ch13 Should I mod the PR to:

iex (@($pre_install) -join '`r`n')
...
iex (@($post_install) -join '`r`n')

@brandon93s
Copy link
Member

+1 for \r\n - consider the use case of an if statement which wouldn't work with ;.

The current implementation is a bit easier to understand to me, but my ps is pretty weak. Checking for an explicit array instead of not string would be even more clear.

@stkb
Copy link
Contributor

stkb commented Jan 26, 2018

To explain, the "array subexpression operator" (@( )) does the check for an array already. It's like a "ensure array" operator. If the value passed in to it is already an array, it leaves it as it is. If it's not an array, it creates a singleton array from it. From there it's just a -join to ensure we always have a string again.

@r15ch13 r15ch13 merged commit 76a38e2 into ScoopInstaller:master Jan 26, 2018
@rasa rasa deleted the rasa-fix-1890 branch January 31, 2018 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants