Skip to content

Commit

Permalink
Merge pull request #83 from hhru/CI_fix
Browse files Browse the repository at this point in the history
Исправление джобы для Linux
  • Loading branch information
VDA22 authored May 17, 2024
2 parents e0d0b9c + d932090 commit 4c6bc32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 10 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ let package = Package(
"DictionaryCoder",
"FigmaGenTools",
"Expression",
"KeychainAccess"
.product(
name: "KeychainAccess",
package: "KeychainAccess",
condition: .when(platforms: [.macOS])
)
],
path: "Sources/FigmaGen"
),
Expand All @@ -46,7 +50,11 @@ let package = Package(
"SwiftCLI",
"PathKit",
"PromiseKit",
"KeychainAccess"
.product(
name: "KeychainAccess",
package: "KeychainAccess",
condition: .when(platforms: [.macOS])
)
],
path: "Sources/FigmaGenTools"
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Foundation
#if os(macOS)
import KeychainAccess
#endif

final class DefaultAccessTokenResolver: AccessTokenResolver {

Expand All @@ -9,9 +11,13 @@ final class DefaultAccessTokenResolver: AccessTokenResolver {
} else if let environmentVariable = configuration?.environmentVariable,
let accessToken = ProcessInfo.processInfo.environment[environmentVariable] {
return accessToken
} else if let parameters = configuration?.keychainParameters,
let accessToken = try? Keychain(service: parameters.service).getString(parameters.key) {
} else if let parameters = configuration?.keychainParameters {
#if os(macOS)
let accessToken = try? Keychain(service: parameters.service).getString(parameters.key)
return accessToken
#else
return nil
#endif
} else {
return nil
}
Expand Down

0 comments on commit 4c6bc32

Please sign in to comment.