Remove public/icons from .slugignore and remove it later

This commit is contained in:
Jasper van Merle 2019-07-20 03:44:22 +02:00
parent 50cd4e13a3
commit 1fd1ed9d23
3 changed files with 9 additions and 4 deletions

View file

@ -1,2 +1 @@
public/icons
test

View file

@ -15,7 +15,7 @@ class AssetsCLI < Thor
option :verbose, type: :boolean
def compile
load 'tasks/sprites.thor'
invoke 'sprites:generate', [], :verbose => options[:verbose]
invoke 'sprites:generate', [], :remove_public_icons => true, :verbose => options[:verbose]
manifest.compile App.assets_compile
manifest.clean(options[:keep]) if options[:clean]

View file

@ -10,7 +10,8 @@ class SpritesCLI < Thor
super
end
desc 'generate [--verbose]', 'Generate the documentation icon spritesheets'
desc 'generate [--remove-public-icons] [--verbose]', 'Generate the documentation icon spritesheets'
option :remove_public_icons, type: :boolean, desc: 'Remove public/icons after generating the spritesheets'
option :verbose, type: :boolean
def generate
items = get_items
@ -44,6 +45,11 @@ class SpritesCLI < Thor
end
save_manifest(items, icons_per_row, 'assets/images/sprites/docs.json')
if options[:remove_public_icons]
logger.info('Removing public/icons')
FileUtils.rm_rf('public/icons')
end
end
private