Skip to content

Commit

Permalink
fix: name the platform using just architecture and os (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones authored Dec 20, 2021
1 parent 270ca32 commit bc12aed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions exe/tailwindcss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ require "shellwords"
require "tailwindcss/upstream"

supported_platforms = Tailwindcss::Upstream::NATIVE_PLATFORMS.keys
platform = [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")

if supported_platforms.none? { |supported_platform| Gem::Platform.match(supported_platform) }
STDERR.puts(<<~ERRMSG)
ERROR: tailwindcss-rails does not support the #{::Gem::Platform.local} platform
ERROR: tailwindcss-rails does not support the #{platform} platform
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
ERRMSG
exit 1
Expand All @@ -19,15 +20,15 @@ exe_path = Dir.glob(File.join(__dir__, "*", "tailwindcss")).find do |f|
end
if exe_path.nil?
STDERR.puts(<<~ERRMSG)
ERROR: Cannot find the tailwindcss executable for #{::Gem::Platform.local} in #{__dir__}
ERROR: Cannot find the tailwindcss executable for #{platform} in #{__dir__}
If you're using bundler, please make sure you're on the latest bundler version:
gem install bundler
bundle update --bundler
Then make sure your lock file includes this platform by running:
bundle lock --add-platform #{::Gem::Platform.local}
bundle lock --add-platform #{platform}
bundle install
See `bundle lock --help` output for details.
Expand Down

0 comments on commit bc12aed

Please sign in to comment.