fix(papermark): replace sed with node to patch next.config has-host item

This commit is contained in:
CanbiZ (MickLesk)
2026-04-15 08:43:52 +02:00
parent c5e6387e69
commit 2bf3d73ef6

View File

@@ -34,7 +34,7 @@ EOF
$STD npm install
$STD npx prisma generate
$STD npx prisma migrate deploy
sed -i -E 's/\{\s*type:\s*"host"\s*\}/{ type: "host", value: ".*" }/g' /opt/papermark/next.config.* 2>/dev/null || true
node -e "['next.config.js','next.config.mjs','next.config.ts'].forEach(n=>{try{const fp='/opt/papermark/'+n,fs=require('fs');let c=fs.readFileSync(fp,'utf8');c=c.replace(/\{(\s*)type(\s*):(\s*)['\"]host['\"](\s*)\}/g,'{type:\"host\",value:\".*\"}');fs.writeFileSync(fp,c)}catch(e){}})" 2>/dev/null || true
$STD npm run build
msg_ok "Set up Papermark"