Closed VictorioBerra closed 8 months ago
Does not work either (using --dir=X
):
bot.run([`serve --dir=${join(__dirname, "pb_data")}`]);
Try each arg as a separate array element.
Worked. Thanks!
Final code:
import { gobot } from "gobot";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
// ES Module way to re-create __dirname :/
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const bot = await gobot(`pocketbase/pocketbase`);
bot.run([`-v`]);
bot.run([`serve`, `--dir=${join(__dirname, "pb_data")}`]);
I have my index.js and my
/pb_data
in the same folder, I think most people will do this. Otherwise, wouldn't upgrading the PB version via GotBot create a new pb_data?Anways, Gobot is not correctly passing the args to pocketbase it seems. As running the command manually works fine:
C:\Users\toryb\AppData\Local\gobot-nodejs\Cache\pocketbase\pocketbase\archives\0.22.7\x64\win32\pocketbase.exe serve --dir 'C:\\Users\\toryb\\source\\repos\\Failreactor-Pocketbase - JS\\pb_data'