-
Notifications
You must be signed in to change notification settings - Fork 15
/
publish-local.sh
57 lines (45 loc) · 1.96 KB
/
publish-local.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
echo "$0";
echo "$1";
rm -rf npm
mkdir npm
cp package.json npm
cp -rf src npm
cp -rf bin npm
cd npm
sed -i '' -e 's/\"name\": \"amis-widget-cli\"/\"name\": \"@fex\/amis-widget-cli\"/g' ./package.json
sed -i '' -e 's/\"amis-editor\":/\"@fex\/amis-editor\":/g' ./package.json
sed -i '' -e 's/\"amis\":/\"@fex\/amis\":/g' ./package.json
for f in $(find ./src -name "*.js"); do
sed -i '' -e "s/from \'amis/from \'@fex\/amis/g" $f
sed -i '' -e "s/from \'amis-editor/from \'@fex\/amis-editor/g" $f
sed -i '' -e "s/from \'amis-widget/from \'@fex\/amis-widget/g" $f
sed -i '' -e "s/import \'amis/import \'@fex\/amis/g" $f
sed -i '' -e "s/import \'amis-editor/import \'@fex\/amis-editor/g" $f
sed -i '' -e "s/import \'amis-widget/import \'@fex\/amis-widget/g" $f
done
for f in $(find ./src -name "*.tsx"); do
sed -i '' -e "s/from \'amis/from \'@fex\/amis/g" $f
sed -i '' -e "s/from \'amis-editor/from \'@fex\/amis-editor/g" $f
sed -i '' -e "s/from \'amis-widget/from \'@fex\/amis-widget/g" $f
sed -i '' -e "s/import \'amis/import \'@fex\/amis/g" $f
sed -i '' -e "s/import \'amis-editor/import \'@fex\/amis-editor/g" $f
sed -i '' -e "s/import \'amis-widget/import \'@fex\/amis-widget/g" $f
done
for f in $(find ./src -name "*.jsx"); do
sed -i '' -e "s/from \'amis/from \'@fex\/amis/g" $f
sed -i '' -e "s/from \'amis-editor/from \'@fex\/amis-editor/g" $f
sed -i '' -e "s/from \'amis-widget/from \'@fex\/amis-widget/g" $f
sed -i '' -e "s/import \'amis/import \'@fex\/amis/g" $f
sed -i '' -e "s/import \'amis-editor/import \'@fex\/amis-editor/g" $f
sed -i '' -e "s/import \'amis-widget/import \'@fex\/amis-widget/g" $f
done
for f in $(find ./src -name "*.scss"); do
sed -i '' -e "s/@import \'amis/@import \'@fex\/amis/g" $f
sed -i '' -e "s/@import \'amis-editor/@import \'@fex\/amis-editor/g" $f
sed -i '' -e "s/@import \'amis-widget/@import \'@fex\/amis-widget/g" $f
done
npm publish --registry=http://registry.npm.baidu-int.com
cd ..
# rm -rf npm