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

Don't use POSIX-specific shell constructs #436

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

oprypin
Copy link
Member

@oprypin oprypin commented Sep 19, 2020

This is part of work to bring 'shards' to Windows.

This is part of work to bring 'shards' to Windows.
@oprypin oprypin mentioned this pull request Sep 19, 2020
5 tasks
@@ -113,7 +113,7 @@ module Shards

protected def self.has_git_command?
if @@has_git_command.nil?
@@has_git_command = Process.run("command -v git", shell: true).success?
@@has_git_command = (Process.run("git", ["--version"]).success? rescue false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@@has_git_command = (Process.run("git", ["--version"]).success? rescue false)
@@has_git_command = Process.run("git", ["--version"]).success? rescue false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can work both ways but just consider what advantages we're weighing here (picking one or the other):

  • Saving two characters.
  • Not having to think what the rescue really applies to every time when reading the code. I literally didn't know what the priority would be and I wanted to save everyone the cognitive load and the possible bugs.

Copy link
Contributor

@Sija Sija Sep 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought it's pretty clear what's going on here (there's nothing else that 'rescue' could apply to), but it's your call.

PS. for me the cognitive load is asking myself why did u do that in the first place ;)

@oprypin
Copy link
Member Author

oprypin commented Oct 26, 2020

@bcardiff have you had a chance to look at my pull requests to Shards?

@straight-shoota straight-shoota linked an issue Oct 30, 2020 that may be closed by this pull request
5 tasks
@straight-shoota straight-shoota added this to the v0.12.0 milestone Nov 5, 2020
@straight-shoota straight-shoota merged commit 9c2f712 into crystal-lang:master Nov 10, 2020
@bcardiff bcardiff modified the milestones: v0.12.0, vNext Nov 10, 2020
f-fr pushed a commit to f-fr/shards that referenced this pull request Jan 2, 2021
This is part of work to bring 'shards' to Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support installing shards on Windows
5 participants