Skip to content

Commit

Permalink
feat(pinger.cr): add support for running uname at compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Feb 4, 2020
1 parent 6c52114 commit 5d15ee9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pinger
version: 1.0.0
version: 1.0.1

authors:
- Caspian Baska <caspianbaska@gmail.com>
Expand Down
6 changes: 5 additions & 1 deletion src/pinger.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class Pinger
VERSION = "0.1.0"

# Host OS
OS = `uname`.strip.downcase
{% if env("UNAME_AT_COMPILE_TIME") %}
OS = {{ system("uname").stringify.strip.downcase }}
{% else %}
OS = `uname`.strip.downcase
{% end %}

@ip : Socket::IPAddress?

Expand Down

0 comments on commit 5d15ee9

Please sign in to comment.