Created
February 26, 2020 08:37
-
-
Save parasquid/402c619553aad5d0bc1447a1711e6c31 to your computer and use it in GitHub Desktop.
Do not run code during assets:precompile
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
# the condition checks if we're running inside rake assets:precompile | |
if !defined?(::Rake::SprocketsTask) | |
FOG_DIRECTORY = begin | |
# try and see if the directory exists | |
FOG_CONNECTION.directories.get(bucket_name) | |
rescue Excon::Error::Forbidden | |
# otherwise let's just create it | |
FOG_CONNECTION.directories.create( | |
key: bucket_name, | |
public: false, | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment