Skip to content

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

Merged
r15ch13 merged 2 commits intoScoopInstaller:masterfrom
rasa:rasa-fix-1890
Jan 26, 2018
Merged

Add multi-line support to pre/post_install (fixes #1890)#1980
r15ch13 merged 2 commits intoScoopInstaller:masterfrom
rasa:rasa-fix-1890

Conversation

@rasa
Copy link
Copy Markdown
Member

@rasa rasa commented Jan 24, 2018

No description provided.

@rasa
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants