Skip to content

Remove swiftly update message from swiftly run command #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Sources/Swiftly/Run.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ struct Run: SwiftlyCommand {
}

mutating func run(_ ctx: SwiftlyCoreContext) async throws {
let versionUpdateReminder = try await validateSwiftly(ctx)
defer {
versionUpdateReminder()
}
try await validateSwiftly(ctx)

var config = try await Config.load(ctx)

// Handle the specific case where help is requested of the run subcommand
Expand Down
2 changes: 1 addition & 1 deletion Sources/Swiftly/SelfUpdate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct SelfUpdate: SwiftlyCommand {
}

mutating func run(_ ctx: SwiftlyCoreContext) async throws {
let _ = try await validateSwiftly(ctx)
try await validateSwiftly(ctx)

let swiftlyBin = Swiftly.currentPlatform.swiftlyBinDir(ctx) / "swiftly"
guard try await fs.exists(atPath: swiftlyBin) else {
Expand Down
1 change: 1 addition & 0 deletions Sources/Swiftly/Swiftly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ extension Data {
}

extension SwiftlyCommand {
@discardableResult
public mutating func validateSwiftly(_ ctx: SwiftlyCoreContext) async throws -> () -> Void {
for requiredDir in Swiftly.requiredDirectories(ctx) {
guard try await fs.exists(atPath: requiredDir) else {
Expand Down