Unified · Split
| @@ -1,2 +1 @@ | |||
| 1 | public/icons | 1 | test |
| 2 | test | ||
| @@ -15,7 +15,7 @@ class AssetsCLI < Thor · 14 unmodified lines | |||
| 15 | option :verbose, type: :boolean | 15 | option :verbose, type: :boolean |
| 16 | def compile | 16 | def compile |
| 17 | load 'tasks/sprites.thor' | 17 | load 'tasks/sprites.thor' |
| 18 | invoke 'sprites:generate', [], :verbose => options[:verbose] | 18 | invoke 'sprites:generate', [], :remove_public_icons => true, :verbose => options[:verbose] |
| 19 | 19 | ||
| 20 | manifest.compile App.assets_compile | 20 | manifest.compile App.assets_compile |
| 21 | manifest.clean(options[:keep]) if options[:clean] | 21 | manifest.clean(options[:keep]) if options[:clean] |
| @@ -10,7 +10,8 @@ class SpritesCLI < Thor · 9 unmodified lines | |||
| 10 | super | 10 | super |
| 11 | end | 11 | end |
| 12 | 12 | ||
| 13 | desc 'generate [--verbose]', 'Generate the documentation icon spritesheets' | 13 | desc 'generate [--remove-public-icons] [--verbose]', 'Generate the documentation icon spritesheets' |
| 14 | option :remove_public_icons, type: :boolean, desc: 'Remove public/icons after generating the spritesheets' | ||
| 14 | option :verbose, type: :boolean | 15 | option :verbose, type: :boolean |
| 15 | def generate | 16 | def generate |
| 16 | items = get_items | 17 | items = get_items |
| @@ -44,6 +45,11 @@ class SpritesCLI < Thor · 27 unmodified lines | |||
| 44 | end | 45 | end |
| 45 | 46 | ||
| 46 | save_manifest(items, icons_per_row, 'assets/images/sprites/docs.json') | 47 | save_manifest(items, icons_per_row, 'assets/images/sprites/docs.json') |
| 48 | |||
| 49 | if options[:remove_public_icons] | ||
| 50 | logger.info('Removing public/icons') | ||
| 51 | FileUtils.rm_rf('public/icons') | ||
| 52 | end | ||
| 47 | end | 53 | end |
| 48 | 54 | ||
| 49 | private | 55 | private |