Skip to content
Open
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
16 changes: 15 additions & 1 deletion Sources/SkipBuild/Commands/DoctorCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,21 @@ extension ToolOptionsCommand where Self : StreamingCommand {

//await checkVersion(title: "ECHO2 VERSION", cmd: ["sh", "-c", "echo ONE ; sleep 1; echo TWO ; sleep 1; echo THREE ; sleep 1; echo 3.2.1"], min: Version("1.2.3"), pattern: "([0-9.]+)", watch: true)

try await checkVersion(title: "Skip version", cmd: [skipcmd, "version"], min: Version(skipVersion), pattern: "Skip version ([0-9.]+)")
// Skip version: special-case debug builds to show .warn (yellow !) instead of .pass
if isDebug {
try await run(with: out, "Skip version", [skipcmd, "version"], watch: false, resultHandler: { result in
guard let skipVersion = try? result?.get().stdout.trimmingCharacters(in: .newlines) else {
return (result, MessageBlock(status: .fail, "Skip version: error executing \(skipcmd)"))
}
if skipVersion.contains("debug") {
return (result, MessageBlock(status: .warn, skipVersion))
} else {
return (result, MessageBlock(status: .pass, "Skip version \(skipVersion) [debug]"))
}
})
} else {
try await checkVersion(title: "Skip version", cmd: [skipcmd, "version"], min: Version(skipVersion), pattern: "Skip version ([0-9.]+)")
}
#if os(macOS)
try await checkVersion(title: "macOS version", cmd: ["sw_vers", "--productVersion"], min: Version("13.5.0"), pattern: "([0-9.]+)")
#endif
Expand Down
8 changes: 7 additions & 1 deletion Sources/SkipBuild/SkipCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import struct Universal.JSON
/// The version of Skip, via `SkipSyntax`
public let skipVersion = SkipSyntax.skipVersion // we don't want to have to import SkipSyntax just to get the version, so re-export it

#if DEBUG
public let isDebug = true
#else
public let isDebug = false
#endif

struct Options {
var preprocessorSymbols: [String] = []
}
Expand Down Expand Up @@ -62,7 +68,7 @@ public func skipstone(_ args: [String]) async throws -> (out: String, err: Strin
public struct SkipRunnerExecutor: SkipCommandExecutor {
public static var configuration = CommandConfiguration(
commandName: "skip",
abstract: "skip \(skipVersion)",
abstract: "skip \(skipVersion)\(isDebug ? " (debug)" : "")",
//version: skipVersion,
shouldDisplay: true,
subcommands: [
Expand Down
Loading