benallfree / gobot Goto Github PK
View Code? Open in Web Editor NEWPopular binaries via npm. CLI and API.
Popular binaries via npm. CLI and API.
Code:
import { gobot } from "gobot";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const bot = await gobot(`pocketbase/pocketbase`, { version: `~0.22.7` });
bot.run([`-v`]);
bot.run([`serve`, `--dir=${join(__dirname, "pb_data")}`]);
Run npm i [email protected]
Broken, color output gone, URL wrong. Exact same index.js code.
const bot = await gobot(`pocketbase/pocketbase`, { version: `~0.22.12` });
bot.exePath // ???????
Need to know where Gobot downloaded the binary. For example if I want to run ./pocketbase migrations create with said binary
.
import { gobot } from "gobot";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
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")}`]);
pocketbase.exe version 0.22.7
Error: unknown command "serve --dir 'C:\\Users\\toryb\\source\\repos\\Failreactor-Pocketbase - JS\\pb_data'" for "pocketbase.exe"
Run 'pocketbase.exe --help' for usage.
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'
It works well when running bun x gobot pocketbase serve
and creates pb_data
& pb_migrations
folder in the directory i ran it
But after adding a simple html file in pb_public
folder in the same directory it fails to detect it and results in a data not found
As illustrated in this vid
file:///C:/Users/toryb/source/repos/Failreactor-Pocketbase%20-%20JS/node_modules/gobot/dist/chunk-Y2WPSBSM.js:435
throw new Error(
^
Error: No release satisfying version ~0.22.8 for win32/x64
https://github.com/pocketbase/pocketbase/releases/tag/v0.22.8
Works when I set it to ~0.22.7 via:
import { gobot } from "gobot";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const bot = await gobot(`pocketbase/pocketbase`, { version: `~0.22.8` });
bot.run([`-v`]);
bot.run([`serve`, `--dir=${join(__dirname, "pb_data")}`]);
const bot = gobot("pocketbase");
bot.versions(["~0.21.0"]);
ERROR
/node_modules/gobot/dist/chunk-J5PBB34S.js:461
throw new Error(`Unknown version format ${type}`);
First it complained with this code:
import { gobot } from "gobot";
const bot = await gobot(`pocketbase`);
bot.run([`--help`]);
Error: pocketbase is not a binary known to Gobot. Try user/repo
this fixed that error:
import { gobot } from "gobot";
const bot = await gobot(`pocketbase/pocketbase`);
bot.run([`--help`]);
Got to say, its a major issue that code copied right off the README does not work. Anyway, after fixing the code, it appears pocketbase.exe downloads correctly, but the error says:
Error: Could not find pocketbase.exe anywhere in path C:\Users\toryb\AppData\Local\gobot-nodejs\Cache\pocketbase\pocketbase\archives\0.22.7\x64\win32
Which is imply not true, ls C:\Users\toryb\AppData\Local\gobot-nodejs\Cache\pocketbase\pocketbase\archives\0.22.7\x64\win32
reveals pocketbase.exe
is right there in the folder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.