Skip to content

Commit

Permalink
Fix check-dependencies.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Jan 5, 2024
1 parent 92093ee commit 19fa7dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Sources/ValidatorCore/Commands/CheckDependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public struct CheckDependencies: AsyncParsableCommand {
@Option(name: .shortAndLong)
var limit: Int = .max

@Option(name: .shortAndLong)
var maxCheck: Int = .max

@Option(name: .shortAndLong, help: "save changes to output file")
var output: String?

Expand Down Expand Up @@ -58,6 +61,7 @@ public struct CheckDependencies: AsyncParsableCommand {
var newPackages = UniqueCanonicalPackageURLs()
for (idx, dep) in missing
.sorted(by: { $0.packageURL.absoluteString < $1.packageURL.absoluteString })
.prefix(maxCheck)
.enumerated() {
if idx % 10 == 0 {
print("Progress:", idx, "/", missing.count)
Expand Down
5 changes: 4 additions & 1 deletion check-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ curl -s https://raw.githubusercontent.com/SwiftPackageIndex/PackageList/main/pac
echo "..."
echo

$validator check-dependencies --use-package-list -o packages.json -l 10 --chunk 1 --number-of-chunks 3
$validator check-dependencies \
--spi-api-token "$SPI_API_TOKEN" \
-i packages.json -o packages.json \
--max-check 1

0 comments on commit 19fa7dc

Please sign in to comment.