Просмотр исходного кода

Fix Docker images, sprites:generate and a favicon cors issue

Jasper van Merle 6 лет назад
Родитель
Сommit
5dbb853606
4 измененных файлов с 5 добавлено и 2 удалено
  1. 1 1
      Dockerfile
  2. 1 1
      Dockerfile-alpine
  3. 1 0
      assets/javascripts/lib/favicon.coffee
  4. 2 0
      lib/tasks/sprites.thor

+ 1 - 1
Dockerfile

@@ -6,7 +6,7 @@ ENV ENABLE_SERVICE_WORKER=true
 WORKDIR /devdocs
 
 RUN apt-get update && \
-    apt-get -y install git nodejs && \
+    apt-get -y install git nodejs libcurl4 && \
     gem install bundler && \
     rm -rf /var/lib/apt/lists/*
 

+ 1 - 1
Dockerfile-alpine

@@ -7,7 +7,7 @@ WORKDIR /devdocs
 
 COPY . /devdocs
 
-RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \
+RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev libcurl && \
     gem install bundler && \
     bundle install --system --without test && \
     thor docs:download --all && \

+ 1 - 0
assets/javascripts/lib/favicon.coffee

@@ -9,6 +9,7 @@ withImage = (url, action) ->
     action(imageCache[url])
   else
     img = new Image()
+    img.crossOrigin = 'anonymous'
     img.src = url
     img.onload = () =>
       imageCache[url] = img

+ 2 - 0
lib/tasks/sprites.thor

@@ -31,6 +31,8 @@ class SpritesCLI < Thor
       item[:dark_icon_fix] = needs_dark_icon_fix(item[:icon_32], bg_color)
     end
 
+    return unless items_with_icons.length > 0
+
     log_details(items_with_icons, icons_per_row)
 
     generate_spritesheet(16, items_with_icons, 'assets/images/sprites/docs.png') {|item| item[:icon_16]}