|
@@ -1,7 +1,7 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
set -e # 如果构建失败,则退出,不能删除旧的包
|
|
set -e # 如果构建失败,则退出,不能删除旧的包
|
|
|
|
|
|
-if [ "$#" -ne 1 ] ; then
|
|
|
|
|
|
+if [ "$#" -ne 1 ]; then
|
|
echo "Usage: $0 BUILD_ENV" >&2
|
|
echo "Usage: $0 BUILD_ENV" >&2
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
@@ -14,11 +14,11 @@ pnpm i
|
|
npm run build:$1
|
|
npm run build:$1
|
|
|
|
|
|
mkdir -p ~/project/examcloud/static-new/oe-web-v3/temp
|
|
mkdir -p ~/project/examcloud/static-new/oe-web-v3/temp
|
|
-cp -r dist ~/project/examcloud/static-new/oe-web-v3/temp
|
|
|
|
|
|
+cp -r dist ~/project/examcloud/static-new/oe-web-v3/temp
|
|
|
|
|
|
cd ~/project/examcloud/static-new/oe-web-v3
|
|
cd ~/project/examcloud/static-new/oe-web-v3
|
|
if [ -d "dist" ]; then
|
|
if [ -d "dist" ]; then
|
|
- currentTime=`date "+%Y%m%d%H%M%S"`
|
|
|
|
|
|
+ currentTime=$(date "+%Y%m%d%H%M%S")
|
|
echo "dist backup... $currentTime"
|
|
echo "dist backup... $currentTime"
|
|
tar cf oe-web-bak-$currentTime.tar.gz dist
|
|
tar cf oe-web-bak-$currentTime.tar.gz dist
|
|
rm -rf dist/*
|
|
rm -rf dist/*
|
|
@@ -27,5 +27,3 @@ fi
|
|
mv temp/dist .
|
|
mv temp/dist .
|
|
rm -rf temp
|
|
rm -rf temp
|
|
echo "ok..."
|
|
echo "ok..."
|
|
-
|
|
|
|
-
|
|
|