Skip to content
Snippets Groups Projects
Commit 6b6d707c authored by Brian Peiris's avatar Brian Peiris
Browse files

allow specifying full url in bot script

parent 54b6567c
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,9 @@ Usage:
./run-bot.js [options]
Options:
-h --host=<host> Hubs host [default: localhost:8080]
-r --room=<room> Room id [default: 234234].
-u --url=<url> Url [default: null].
-h --host=<host> Hubs host if url is not specified [default: localhost:8080]
-r --room=<room> Room id [default: null].
-h --help Show this screen.
`;
......@@ -22,12 +23,19 @@ const querystring = require("query-string");
page.on("error", err => console.error("ERROR: ", err));
page.on("pageerror", err => console.error("PAGE ERROR: ", err));
const baseUrl = options["--url"] || `https://${options["--host"]}/hub.html`;
const params = {
room: options["--room"],
bot: true
bot: true,
allow_multi: true
};
console.log(params);
const url = `https://${options["--host"]}/hub.html?${querystring.stringify(params)}`;
const roomOption = options["--room"];
if (roomOption) {
params.room = roomOption;
}
const url = `${baseUrl}?${querystring.stringify(params)}`;
console.log(url);
const navigate = async () => {
try {
......
......@@ -9,7 +9,6 @@ yarn
echo 'Building Hubs'
yarn build > /dev/null
# install run-bot.js dependencies
cd $script_directory
echo 'Installing bot dependencies'
yarn
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment