2023-07-20 05:54:46 +09:00
|
|
|
#!/usr/bin/env bash
|
2023-07-22 20:25:52 +09:00
|
|
|
function copy_missing_file {
|
|
|
|
[ -f "packages/backend/native-utils/built/index.js" ] \
|
|
|
|
|| cp packages/index.js packages/backend/native-utils/built/index.js
|
|
|
|
}
|
|
|
|
|
2023-07-20 05:54:46 +09:00
|
|
|
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
|
2023-07-22 20:25:52 +09:00
|
|
|
NODE_ENV=production pnpm run rebuild \
|
|
|
|
&& copy_missing_file \
|
|
|
|
&& pnpm run migrate
|