fix
This commit is contained in:
+18
-5
@@ -97,6 +97,23 @@ function run(command, args, options = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
async function ensureBuildDependencies() {
|
||||
await run('npm', ['install', '--production=false', '--include=dev', '--omit=optional'], {
|
||||
env: {
|
||||
NODE_ENV: 'development',
|
||||
npm_config_include: 'dev',
|
||||
npm_config_omit: 'optional',
|
||||
npm_config_production: 'false',
|
||||
},
|
||||
})
|
||||
|
||||
try {
|
||||
require.resolve('@vitejs/plugin-react')
|
||||
} catch {
|
||||
throw new Error('@vitejs/plugin-react is missing after npm install; dev dependencies were not installed')
|
||||
}
|
||||
}
|
||||
|
||||
function postDiscordWebhook(payload) {
|
||||
if (!DISCORD_WEBHOOK_URL) return Promise.resolve()
|
||||
|
||||
@@ -162,11 +179,7 @@ function notifyDiscordRestart() {
|
||||
|
||||
async function deploy() {
|
||||
await run('git', ['pull', '--ff-only'])
|
||||
await run('npm', ['install', '--include=dev'], {
|
||||
env: {
|
||||
npm_config_production: 'false',
|
||||
},
|
||||
})
|
||||
await ensureBuildDependencies()
|
||||
await run('npm', ['run', 'build'])
|
||||
|
||||
for (const target of RESTART_TARGETS) {
|
||||
|
||||
Reference in New Issue
Block a user