This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :icon do | |
require "net/http" | |
require "json" | |
desc "Fetch an iconify icon and save it as partial `bin/rails icon:fetch ICON=heroicons:light-bulb`" | |
task fetch: :environment do | |
icon_name = ENV["ICON"] | |
if icon_name.nil? || icon_name.strip.empty? | |
puts "ERROR: Please provide an icon name using the ICON environment variable (e.g., bin/rails icon:fetch ICON=heroicons:light-bulb)" |
OlderNewer