Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-03-10 00:32:11 +0300
committerClement Ho <clemmakesapps@gmail.com>2018-03-10 00:32:11 +0300
commitb6a59ccc8f5c7a914627bd0504f879544514d72b (patch)
tree40645942e343681261be02381842452aadd239ce /config
parent0c4c8054beb75f056e0437a26cc6478bc6ebd453 (diff)
Remove sync script for gitlab-svgs and reference the vendored library directly
Diffstat (limited to 'config')
-rw-r--r--config/application.rb6
-rw-r--r--config/svg.config.js48
2 files changed, 6 insertions, 48 deletions
diff --git a/config/application.rb b/config/application.rb
index ac6e4be4282..422b16a7719 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -117,6 +117,12 @@ module Gitlab
config.assets.precompile << "test.css"
config.assets.precompile << "locale/**/app.js"
+ # Import gitlab-svgs directly from vendored directory
+ config.assets.paths << "#{config.root}/node_modules/@gitlab-org/gitlab-svgs/dist"
+ config.assets.precompile << "icons.svg"
+ config.assets.precompile << "icons.json"
+ config.assets.precompile << "illustrations/*.svg"
+
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
diff --git a/config/svg.config.js b/config/svg.config.js
deleted file mode 100644
index bb27f0caeef..00000000000
--- a/config/svg.config.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* eslint-disable no-commonjs */
-const path = require('path');
-const fs = require('fs');
-
-const sourcePath = path.join('node_modules', '@gitlab-org/gitlab-svgs', 'dist');
-const sourcePathIllustrations = path.join('node_modules', '@gitlab-org/gitlab-svgs', 'dist', 'illustrations');
-const destPath = path.normalize(path.join('app', 'assets', 'images'));
-
-// Actual Task copying the 2 files + all illustrations
-copyFileSync(path.join(sourcePath, 'icons.svg'), destPath);
-copyFileSync(path.join(sourcePath, 'icons.json'), destPath);
-copyFolderRecursiveSync(sourcePathIllustrations, destPath);
-
-// Helper Functions
-function copyFileSync(source, target) {
- var targetFile = target;
- //if target is a directory a new file with the same name will be created
- if (fs.existsSync(target)) {
- if (fs.lstatSync(target).isDirectory()) {
- targetFile = path.join(target, path.basename(source));
- }
- }
- console.log(`Copy SVG File : ${targetFile}`);
- fs.writeFileSync(targetFile, fs.readFileSync(source));
-}
-
-function copyFolderRecursiveSync(source, target) {
- var files = [];
-
- //check if folder needs to be created or integrated
- var targetFolder = path.join(target, path.basename(source));
- if (!fs.existsSync(targetFolder)) {
- fs.mkdirSync(targetFolder);
- }
-
- //copy
- if (fs.lstatSync(source).isDirectory()) {
- files = fs.readdirSync(source);
- files.forEach(function (file) {
- var curSource = path.join(source, file);
- if (fs.lstatSync(curSource).isDirectory()) {
- copyFolderRecursiveSync(curSource, targetFolder);
- } else {
- copyFileSync(curSource, targetFolder);
- }
- });
- }
-}