1
0
Fork 1
mirror of https://example.com synced 2024-11-22 23:26:39 +09:00
firefish/update.sh

17 lines
510 B
Bash
Executable file

#!/usr/bin/env bash
function copy_missing_file {
[ -f "packages/backend/native-utils/built/index.js" ] \
|| cp packages/index.js packages/backend/native-utils/built/index.js
}
git checkout -- package.json packages/backend/assets
git pull --ff
COMMIT=$(git rev-parse --short HEAD)
sed -i -r "s/\"version\": \"([^+]+).*\",$/\"version\": \"\\1+neko:${COMMIT}\",/" package.json
corepack prepare pnpm@latest --activate
pnpm i
NODE_ENV=production pnpm run rebuild \
&& copy_missing_file \
&& pnpm run migrate