1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-08-31 01:30:04 +02:00

New import script

This commit is contained in:
codecalm
2022-03-12 23:42:15 +01:00
parent aeb94bc15d
commit 9c4af5ceb8
2 changed files with 35 additions and 0 deletions

2
.gitignore vendored
View File

@@ -15,3 +15,5 @@ src/test*.svg
icons-react/dist/
/_import.csv
compile-options.json
new/
new/*

33
_import.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
rm ./new/Artboard.svg
for file in ./new/*.svg
do
echo "${file}"
sed -i "" 's/---//g' ${file}
sed -i "" 's/fill="none"//g' ${file}
sed -i "" 's/fill-rule="evenodd"//g' ${file}
sed -i "" 's/stroke-linecap="round"//g' ${file}
sed -i "" 's/stroke-linejoin="round"//g' ${file}
sed -i "" 's/viewBox="0 0 24 24"//g' ${file}
sed -i "" 's/stroke="#000000"//g' ${file}
sed -i "" 's/stroke="#000"//g' ${file}
sed -i "" 's/stroke-width="2"//g' ${file}
sed -i "" 's/width="24"//g' ${file}
sed -i "" 's/width="24px"//g' ${file}
sed -i "" 's/height="24"//g' ${file}
sed -i "" 's/height="24px"//g' ${file}
sed -i "" 's/xmlns="http:\/\/www.w3.org\/2000\/svg"//g' ${file}
sed -i "" 's/<path d="M0 0h24v24H0z"\/>"//g' ${file}
done
svgo -f ./new/ --pretty --disable mergePaths
for file in ./new/*.svg
do
echo "${file}"
sed -i "" -e $'s/<svg>/---\\\n---\\\n<svg>/g' ${file}
done
cp ./new/* ./src/_icons/