Skip to content

Commit

Permalink
Merge pull request #7 from nobodywasishere/main
Browse files Browse the repository at this point in the history
Small improvements
  • Loading branch information
devnote-dev authored Oct 11, 2024
2 parents c2931f9 + 8e813e4 commit 3aea4c1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/commands/import.cr
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module Crimson::Commands
end
end
{% else %}
unless File.exists?(path / ".build" / "crystal") && File.executable?(path / ".build" / "crystal")
unless File.exists?(path / ".build" / "crystal") && File::Info.executable?(path / ".build" / "crystal")
error "Crystal binary not found"
fatal "Crystal must be compiled via make before importing"
end
Expand Down
12 changes: 5 additions & 7 deletions src/env.cr
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ module Crimson::ENV
{% end %}
end

{% if flag?(:win32) %}
require "./env/win32"
{% elsif flag?(:darwin) %}
require "./env/darwin"
{% elsif flag?(:unix) %}
require "./env/linux"
{% else %}
require "./env/win32"
require "./env/darwin"
require "./env/linux"

{% if !flag?(:win32) && !flag?(:darwin) && !flag?(:linux) %}
{% raise "unsupported platform target" %}
{% end %}
2 changes: 2 additions & 0 deletions src/env/darwin.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file unless flag?(:darwin) %}

require "compress/gzip"
require "crystar"

Expand Down
2 changes: 2 additions & 0 deletions src/env/linux.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file unless flag?(:unix) && !flag?(:darwin) %}

require "compress/gzip"
require "crystar"

Expand Down
2 changes: 2 additions & 0 deletions src/env/win32.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file unless flag?(:win32) %}

require "compress/zip"
require "crystal/system/win32/visual_studio"
require "crystal/system/win32/windows_sdk"
Expand Down

0 comments on commit 3aea4c1

Please sign in to comment.