代码拉取完成,页面将自动刷新
#! /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!"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。