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 @@
1public/icons1test
2test
lib/tasks/assets.thor+1−1
@@ -15,7 +15,7 @@ class AssetsCLI < Thor · 14 unmodified lines
15 option :verbose, type: :boolean15 option :verbose, type: :boolean
16 def compile16 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_compile20 manifest.compile App.assets_compile
21 manifest.clean(options[:keep]) if options[:clean]21 manifest.clean(options[:keep]) if options[:clean]
lib/tasks/sprites.thor+7−1
@@ -10,7 +10,8 @@ class SpritesCLI < Thor · 9 unmodified lines
10 super10 super
11 end11 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: :boolean15 option :verbose, type: :boolean
15 def generate16 def generate
16 items = get_items17 items = get_items
@@ -44,6 +45,11 @@ class SpritesCLI < Thor · 27 unmodified lines
44 end45 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 end53 end
48 54
49 private55 private