加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
publish.sh 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2017-12-12 22:08 . init
#! /bin/bash
# todo
#get version from sdk/package.json
version=`grep version sdk/package.json|awk -F '"' '{printf("%s",$4)}'`
echo version=$version
#replace follows manually first so far(will replaced by shell script automatically later):
#sdk/package.json
#sdk/README.md
#sdk/demo.html
#package.json
#CHANGELOG.md
#index.html
#webpack.config.js
#build/webpack.dev.js
#build/webpack.prod.js
echo 'webpack begin...'
webpack
echo 'webpack done!'
rm -rf web-im
rm -f web-im-*.zip
rm -rf publish
mkdir -p publish/demo/javascript
cp -r demo/images publish/demo
cp -r demo/stylesheet publish/demo
cp -r demo/javascript/dist publish/demo/javascript/
cp -r demo/javascript/src publish/demo/javascript/
mkdir publish/sdk
cp -r sdk/dist publish/sdk
cp -r sdk/src publish/sdk
cp sdk/*.* publish/sdk
cp -r webrtc publish
cp favicon.ico publish/
cp index.html publish/
cp CHANGELOG.md publish/
cp package.json publish/
cp webpack.config.js publish/
cp README.md publish/
cp .babelrc publish/
file_conf="./demo/javascript/dist/webim.config.js"
if [ ! -f "$file_conf" ]; then
mv publish/demo/javascript/dist/webim.config.js.default publish/demo/javascript/dist/webim.config.js
fi
# windowSDK: delete webRTC associated files
isWindowSDK=`grep 'isWindowSDK' ./demo/javascript/dist/webim.config.js |awk -F ':' '{printf("%s",$2)}' |awk -F ',' '{printf("%s",$1)}'`
echo isWindowSDK=${isWindowSDK##* }
if [ ${isWindowSDK##* } == 'true' ]
then
rm -rf publish/webrtc
rm -rf publish/demo/javascript/src
rm -rf publish/sdk/src
sed -i '32,38d' publish/index.html
fi
# not debug mode: 1.delete debug.js, 2.strophe.js->strophe-1.2.8.min.js
isDebug=`grep 'isDebug' ./demo/javascript/dist/webim.config.js |awk -F ':' '{printf("%s",$2)}' |awk -F ',' '{printf("%s",$1)}'`
echo isDebug=${isDebug##* }
if [ ${isDebug##* } == 'false' ]
then
sed -i '28d' publish/index.html
sed -i '23,25d' publish/index.html
fi
if [ ${isWindowSDK##* } == 'false' ]
then
sed -i '20,22d' publish/index.html
fi
echo 'publish done!'
mv publish web-im
zip -r web-im-${version}.zip web-im > /dev/null
rm -rf web-im
echo "web-im-${version}.zip created!"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化