Files
CID/scripts/build.sh
2025-10-30 19:34:04 +08:00

28 lines
519 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 获取脚本地址
script_path=$(cd `dirname $0`; pwd)
cd $script_path
# 前往脚本目录上一层
cd ../
# 拉取最新代码
git reset --hard
git pull
# 构建
pnpm i
pnpm build
# 打包成文件名带有时间戳的tar.gz
tar -czvf dist.tar.gz dist
# 判断是否有用户目录下的packages文件夹
if [ ! -d ~/packages ]; then
mkdir ~/packages
fi
# 移动到用户目录下的packages文件夹中并使用时间戳重命名
mv dist.tar.gz ~/packages/dist-$(date +%Y%m%d%H%M%S).tar.gz