History

Remove public/icons from .slugignore and remove it later

Jasper van Merle committed 7 years ago

Commit 1fd1ed91 parent 50cd4e13 files · +9 −4Browse files

Unified · Split

3 files
  1. .slugignore +1 −2
  2. lib/tasks/assets.thor +1 −1
  3. lib/tasks/sprites.thor +7 −1
.slugignore+1−2
@@ -1,2 +1 @@
1−public/icons
2−test
1+test
lib/tasks/assets.thor+1−1
@@ -15,7 +15,7 @@ class AssetsCLI < Thor · 14 unmodified lines
1515 option :verbose, type: :boolean
1616 def compile
1717 load 'tasks/sprites.thor'
18− invoke 'sprites:generate', [], :verbose => options[:verbose]
18+ invoke 'sprites:generate', [], :remove_public_icons => true, :verbose => options[:verbose]
1919
2020 manifest.compile App.assets_compile
2121 manifest.clean(options[:keep]) if options[:clean]
lib/tasks/sprites.thor+7−1
@@ -10,7 +10,8 @@ class SpritesCLI < Thor · 9 unmodified lines
1010 super
1111 end
1212
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'
1415 option :verbose, type: :boolean
1516 def generate
1617 items = get_items
@@ -44,6 +45,11 @@ class SpritesCLI < Thor · 27 unmodified lines
4445 end
4546
4647 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
4753 end
4854
4955 private