generated from digitalservicebund/npm-package-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·33 lines (21 loc) · 1021 Bytes
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o verbose
tmp_path="./tmp"
react_tmp_path=$tmp_path"/react"
original_svg_path=$tmp_path"/material-ui/packages/mui-icons-material/material-icons"
dist_path="./dist/"
rm -rf $tmp_path $dist_path
mkdir -p $react_tmp_path $dist_path
git clone --depth=1 --branch=master "https://github.com/mui/material-ui.git" $tmp_path/material-ui
rm $original_svg_path/screen_search_desktop_24px.svg
for file in $original_svg_path/*_24px.svg;
do
mv "$file" "${file/_24px/}"
done
npx @svgr/cli --index-template index-template.cjs --template component-template.cjs --typescript --no-svgo --svg-props role="graphics-symbol img" --svg-props focusable=false --svg-props aria-hidden=true --out-dir $react_tmp_path -- $original_svg_path
ls $react_tmp_path > files.txt
cd $react_tmp_path
npx tsc --target es6 --module nodenext --moduleResolution nodenext --jsx react-jsx --outDir ../../$dist_path --declaration --declarationDir ../../$dist_path @../../files.txt