Skip to content
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: 6 additions & 0 deletions Scripts/change_is_develop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

IS_DEVELOP=$1

sed "s/let isDevelop = .*/let isDevelop = $IS_DEVELOP/" Package.swift > tmpPackage.swift
mv -f tmpPackage.swift Package.swift
4 changes: 2 additions & 2 deletions Sources/RunnerLib/Runtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum Runtime {
"Dangerfile.swift",
"Danger.swift",
"danger/Dangerfile.swift",
"Danger/Dangerfile.swift"
"Danger/Dangerfile.swift",
]

/// Finds a Dangerfile from the current working directory
Expand All @@ -21,7 +21,7 @@ public enum Runtime {
".build/x86_64-unknown-linux/debug", // Danger Swift's CI
".build/release", // Testing prod
"/usr/local/lib/danger", // Intel Homebrew installs lib stuff to here
"/opt/homebrew/lib/danger" // Apple Silicon Homebrew installs lib stuff to here
"/opt/homebrew/lib/danger", // Apple Silicon Homebrew installs lib stuff to here
]

/// Finds a path to add at runtime to the compiler, which links
Expand Down
10 changes: 5 additions & 5 deletions Sources/RunnerLib/VersionChecker.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DangerShellExecutor
import Foundation
import Logger
import Version
import Foundation

public struct VersionChecker {
private let shellExecutor: ShellExecuting
Expand Down Expand Up @@ -40,11 +40,11 @@ private extension VersionChecker {
do {
let latest = try shellExecutor.execute("curl",
arguments: [
"-s",
"https://api.github.com/repos/danger/swift/releases/latest"
"-s",
"https://api.github.com/repos/danger/swift/releases/latest",
])
.data(using: .utf8)
.flatMap { try decoder.decode(Release.self, from: $0) }
.data(using: .utf8)
.flatMap { try decoder.decode(Release.self, from: $0) }
return latest?.tagName
} catch {
logger.debug(error)
Expand Down
5 changes: 2 additions & 3 deletions Tests/RunnerLibTests/VersionCheckerTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// VersionCheckerTests.swift
//
//
//
// Created by 417.72KI on 2022/02/20.
//
Expand All @@ -10,7 +10,6 @@ import Logger
import XCTest

final class VersionCheckerTests: XCTestCase {

private var executor: MockedExecutor!
private var spyPrinter: SpyPrinter!

Expand Down Expand Up @@ -52,6 +51,6 @@ final class VersionCheckerTests: XCTestCase {

private extension VersionCheckerTests {
func mockResult(tagName: String) -> (String) -> String {
{ _ in #"{"tagName": "\#(tagName)"}"# }
{ _ in #"{"tagName": "\#(tagName)"}"# }
}
}
11 changes: 11 additions & 0 deletions Tests/RunnerLibTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@
]
}

extension VersionCheckerTests {
// DO NOT MODIFY: This is autogenerated, use:
// `swift test --generate-linuxmain`
// to regenerate.
static let __allTests__VersionCheckerTests = [
("testItNotShowNotificationIfRunningIsLatest", testItNotShowNotificationIfRunningIsLatest),
("testItShowsNotificationIfNewVersionIsAvailable", testItShowsNotificationIfNewVersionIsAvailable),
]
}

public func __allTests() -> [XCTestCaseEntry] {
[
testCase(CliParserTests.__allTests__CliParserTests),
Expand All @@ -137,6 +147,7 @@
testCase(ImportsFinderTests.__allTests__ImportsFinderTests),
testCase(SPMDangerTests.__allTests__SPMDangerTests),
testCase(StringPathExtensionTests.__allTests__StringPathExtensionTests),
testCase(VersionCheckerTests.__allTests__VersionCheckerTests),
]
}
#endif