Skip to content

Commit c601684

Browse files
committed
Add --no-detect opt to direct_deploy CLI
1 parent 3d91298 commit c601684

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
This allows restricting processing to a stable
1515
subset of paths.
1616
Intended for dev use and benchmarking.
17+
- Add a "--no-detect" option to the direct_deploy
18+
CLI command that skips the detect step.
1719

1820
## 9.2.1 (2025-07-18)
1921

src/CLI.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ public function deploy(
201201
* <post-id>
202202
* : Post ID to deploy. Deploys all files if omitted.
203203
*
204+
* [--no-detect]
205+
* : Skip detect step and crawl only previously detected
206+
* paths.
207+
*
204208
* [--path-hash-prefix=<prefix>]
205209
* : Ignore paths that do not match the hash prefix.
206210
*/
@@ -212,6 +216,7 @@ public function direct_deploy(
212216
'post-id' => null,
213217
];
214218
$assoc_opts = [
219+
'detect' => null,
215220
'path-hash-prefix' => null,
216221
];
217222
$cfg = self::parse( $args, $assoc_args, $opts, $assoc_opts );
@@ -225,7 +230,8 @@ public function direct_deploy(
225230
path_hash_prefix: $path_hash_prefix,
226231
);
227232
$direct_deploy_config = new DirectDeployConfig(
228-
$crawl_config
233+
crawl_config: $crawl_config,
234+
do_detect: ( $cfg['detect'] ?? true ) !== false,
229235
);
230236
$deployer = new DirectDeployer( $direct_deploy_config );
231237
if ( ! $deployer->ready ) {

src/DirectDeployConfig.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
final class DirectDeployConfig {
66

77
public readonly CrawlConfig $crawl_config;
8+
public readonly bool $do_detect;
89

910
public function __construct(
1011
?CrawlConfig $crawl_config = null,
12+
?bool $do_detect = true,
1113
) {
1214
$this->crawl_config = $crawl_config ?? new CrawlConfig();
15+
$this->do_detect = $do_detect;
1316
}
1417

1518
/**
@@ -19,6 +22,7 @@ public function toArray(): array
1922
{
2023
return [
2124
'crawl_config' => $this->crawl_config,
25+
'do_detect' => $this->do_detect,
2226
];
2327
}
2428
}

0 commit comments

Comments
 (0)