2025-11-16 06:28:11 -08:00

32 lines
548 B
JavaScript

#!/usr/bin/env node
import spawn from 'nano-spawn';
async function main() {
// upload the site
await spawn('rsync', [
'-avz',
'--delete',
'--exclude=pocketbase',
'--exclude=std.log',
'--exclude=pb_data',
'--exclude=*.local',
'-e',
'ssh',
'.',
'root@fp:/home/pb/pb'
], {
stdio: 'inherit'
});
// fix ownership
await spawn('ssh', ['fp', 'chown', '-R', 'pb:pb', '/home/pb/pb']);
// restart pocketbase
await spawn('systemctl', ['--host=fp', 'restart', 'pocketbase.service']);
}
main();