#!/usr/bin/env node import spawn from 'nano-spawn'; async function main() { // upload the site await spawn('rsync', [ '-avz', '--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();