summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-07-17 17:15:12 +0200
committerGitHub <noreply@github.com>2020-07-17 18:15:12 +0300
commit0e24af6951fa65d5094ab6da0f182697aab2a6f0 (patch)
treedf34876b8999a641267a09da3eee5f613b681b42 /build
parent4fa2e217c171ab321e1c0322f48d70d327e8f596 (diff)
downloadgitea-0e24af6951fa65d5094ab6da0f182697aab2a6f0.tar.gz
gitea-0e24af6951fa65d5094ab6da0f182697aab2a6f0.zip
Update Octicons to v10 (#12240)
* Update Octicons to v10 Besides a few renames, these icons are no longer present in v10 that we've used, so had to change: file-symlink-directory -> file-submodule internal-repo -> repo repo-force-push -> repo-push repo-template-private -> repo-template Fixes: https://github.com/go-gitea/gitea/issues/11889 Ref: https://github.com/primer/octicons/releases/tag/v10.0.0 * add custom sliders svg for removed octicon-settings * apply suggestion * fix triangles and use play on admin dashboard * add custom mirror svg * add missing build files * unify custom svgs * move to octicon-repo-clone to gitea-mirror * use octicon-x on conflicts * tweak timeline icons * tweak comment buttons * update settings icon to octicons v1 * switch to octicon-mirror and octicon-tools * replace two wiki buttons with octicons * remove whitespace in svg sources * Fix filepath basename on Windows for SVG bindata (#12241) * move octicons to devDependencies * move back to dependencies * move svgo to devDependencies again Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'build')
-rwxr-xr-xbuild/generate-svg.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/build/generate-svg.js b/build/generate-svg.js
index f2c2d3ed8a..96a4f5fadb 100755
--- a/build/generate-svg.js
+++ b/build/generate-svg.js
@@ -15,7 +15,9 @@ function exit(err) {
}
async function processFile(file, {prefix = ''} = {}) {
- const name = `${prefix}${parse(file).name}`;
+ let name = parse(file).name;
+ if (prefix) name = `${prefix}-${name}`;
+ if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons
const svgo = new Svgo({
plugins: [
@@ -50,8 +52,8 @@ async function main() {
await mkdir(outputDir);
} catch {}
- for (const file of glob('../node_modules/@primer/octicons/build/svg/*.svg')) {
- await processFile(file, {prefix: 'octicon-'});
+ for (const file of glob('../node_modules/@primer/octicons/build/svg/*-16.svg')) {
+ await processFile(file, {prefix: 'octicon'});
}
for (const file of glob('../web_src/svg/*.svg')) {