12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
- import PackagePlugin
16
15
import Foundation
16
+ import PackagePlugin
17
17
18
18
@main
19
19
@available ( macOS 15 . 0 , * )
@@ -112,7 +112,9 @@ struct AWSLambdaPackager: CommandPlugin {
112
112
guard let buildPathOutput = dockerBuildOutputPath. split ( separator: " \n " ) . last else {
113
113
throw Errors . failedParsingDockerOutput ( dockerBuildOutputPath)
114
114
}
115
- let buildOutputPath = URL ( string: buildPathOutput. replacingOccurrences ( of: " /workspace/ " , with: packageDirectory. description) ) !
115
+ let buildOutputPath = URL (
116
+ string: buildPathOutput. replacingOccurrences ( of: " /workspace/ " , with: packageDirectory. description)
117
+ ) !
116
118
117
119
// build the products
118
120
var builtProducts = [ LambdaProduct: URL] ( )
@@ -126,7 +128,7 @@ struct AWSLambdaPackager: CommandPlugin {
126
128
// just like Package.swift's examples assume ../.., we assume we are two levels below the root project
127
129
let slice = packageDirectory. pathComponents. suffix ( 2 )
128
130
let beforeLastComponent = packageDirectory. pathComponents [ slice. startIndex]
129
- let lastComponent = packageDirectory. pathComponents [ slice. endIndex- 1 ]
131
+ let lastComponent = packageDirectory. pathComponents [ slice. endIndex - 1 ]
130
132
try Utils . execute (
131
133
executable: dockerToolPath,
132
134
arguments: [
@@ -302,7 +304,7 @@ private struct Configuration: CustomStringConvertible {
302
304
var isDirectory : Bool = false
303
305
#else
304
306
var isDirectory : ObjCBool = false
305
- #endif
307
+ #endif
306
308
guard FileManager . default. fileExists ( atPath: outputPath, isDirectory: & isDirectory)
307
309
else {
308
310
throw Errors . invalidArgument ( " invalid output directory ' \( outputPath) ' " )
@@ -447,7 +449,9 @@ private struct LambdaProduct: Hashable {
447
449
extension PackageManager . BuildResult {
448
450
// find the executable produced by the build
449
451
func executableArtifact( for product: Product ) -> PackageManager . BuildResult . BuiltArtifact ? {
450
- let executables = self . builtArtifacts. filter { $0. kind == . executable && $0. url. lastPathComponent == product. name }
452
+ let executables = self . builtArtifacts. filter {
453
+ $0. kind == . executable && $0. url. lastPathComponent == product. name
454
+ }
451
455
guard !executables. isEmpty else {
452
456
return nil
453
457
}
0 commit comments