glidercli 0.4.12 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/glider.js +6 -2
- package/lib/bexplore.js +6 -2
- package/package.json +1 -1
package/bin/glider.js
CHANGED
|
@@ -3218,7 +3218,10 @@ async function cmdExplore(url, opts = []) {
|
|
|
3218
3218
|
let closeOnDone = false;
|
|
3219
3219
|
|
|
3220
3220
|
for (let i = 0; i < opts.length; i++) {
|
|
3221
|
-
if (opts[i] === '--depth' || opts[i] === '-d')
|
|
3221
|
+
if (opts[i] === '--depth' || opts[i] === '-d') {
|
|
3222
|
+
const n = parseInt(opts[++i], 10);
|
|
3223
|
+
depth = n === 0 ? 0 : Infinity;
|
|
3224
|
+
}
|
|
3222
3225
|
else if (opts[i] === '--output' || opts[i] === '-o') outputDir = opts[++i];
|
|
3223
3226
|
else if (opts[i] === '--har') harFile = opts[++i];
|
|
3224
3227
|
else if (opts[i] === '--session-id' || opts[i] === '--session') sessionId = opts[++i];
|
|
@@ -3264,7 +3267,8 @@ async function cmdExplore(url, opts = []) {
|
|
|
3264
3267
|
const bexplorePath = path.join(LIB_DIR, 'bexplore.js');
|
|
3265
3268
|
if (fs.existsSync(bexplorePath)) {
|
|
3266
3269
|
const { spawn } = require('child_process');
|
|
3267
|
-
const spawnArgs = [bexplorePath, url, '--
|
|
3270
|
+
const spawnArgs = [bexplorePath, url, '--output', outputDir];
|
|
3271
|
+
if (depth === 0) spawnArgs.push('--depth', '0');
|
|
3268
3272
|
if (harFile) spawnArgs.push('--har', harFile);
|
|
3269
3273
|
if (sessionId) spawnArgs.push('--session-id', sessionId);
|
|
3270
3274
|
|
package/lib/bexplore.js
CHANGED
|
@@ -953,8 +953,12 @@ Examples:
|
|
|
953
953
|
|
|
954
954
|
for (let i = 0; i < args.length; i++) {
|
|
955
955
|
if (args[i] === '--depth') {
|
|
956
|
-
const
|
|
957
|
-
depth =
|
|
956
|
+
const raw = String(args[++i] ?? '');
|
|
957
|
+
if (/^inf(inity)?$/i.test(raw)) depth = Infinity;
|
|
958
|
+
else {
|
|
959
|
+
const n = parseInt(raw, 10);
|
|
960
|
+
depth = n === 0 ? 0 : Infinity;
|
|
961
|
+
}
|
|
958
962
|
}
|
|
959
963
|
else if (args[i] === '--output') outputDir = args[++i];
|
|
960
964
|
else if (args[i] === '--har') harFile = args[++i];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glidercli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"description": "Browser automation CLI. Control a configured Chromium browser through an extension CDP relay, run YAML tasks, and execute bounded autonomous loops.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"glider": "bin/glider.js"
|