amis/publish-to-internal.sh

33 lines
711 B
Bash
Raw Normal View History

2022-06-06 17:28:39 +08:00
#!/bin/bash
set -e
2022-06-07 16:28:28 +08:00
# npm run build --workspaces
2022-06-06 17:28:39 +08:00
rm -rf npm
mkdir npm
cp -rf packages npm
cp package.json npm
cd npm
# package.json 里面把包名称换了
2022-06-07 11:40:09 +08:00
for f in $(find ./packages -name "package.json"); do
2022-06-06 17:28:39 +08:00
sed -i '' -e 's/\"name\": \"amis/\"name\": \"@fex\/amis/g' $f
2022-06-07 11:40:09 +08:00
sed -i '' -e 's/\"amis-/\"@fex\/amis-/g' $f
2022-06-06 17:28:39 +08:00
done
# 把代码里面import的部分换成内部包名称
2022-06-07 11:40:09 +08:00
for f in $(find ./packages/*/lib -type f -name "*.js"); do
2022-06-06 17:28:39 +08:00
sed -i '' -e "s/\'amis/\'@fex\/amis/g" $f
done
2022-06-07 16:28:28 +08:00
for f in $(find ./packages/*/lib -type f -name "*.ts"); do
sed -i '' -e "s/\'amis/\'@fex\/amis/g" $f
done
# npm publish --workspaces --registry=http://registry.npm.baidu-int.com --ignore-scripts
2022-06-06 17:28:39 +08:00
cd ..
# rm -rf npm