@@ -102,9 +102,9 @@ struct AWSLambdaPackager: CommandPlugin {
102
102
103
103
// create and execute a plugin helper to run the "swift" command
104
104
let helperFilePath = " \( projectDirectory) /compile.sh "
105
- let helperFileUrl = URL ( fileURLWithPath : helperFilePath)
106
- try helperCmd . write ( to : helperFileUrl , atomically : true , encoding : . utf8)
107
- try FileManager . default . setAttributes ( [ . posixPermissions: 0o755 ] , ofItemAtPath : helperFilePath )
105
+ FileManager . default . createFile ( atPath : helperFilePath,
106
+ contents : helperCmd . data ( using : . utf8) ,
107
+ attributes : [ . posixPermissions: 0o755 ] )
108
108
let samDeploymentDescriptor = try Utils . execute (
109
109
executable: Path ( " /bin/bash " ) ,
110
110
arguments: [ " -c " , helperFilePath] ,
@@ -116,12 +116,11 @@ struct AWSLambdaPackager: CommandPlugin {
116
116
// arguments: Array(cmd.dropFirst()),
117
117
// customWorkingDirectory: context.package.directory,
118
118
// logLevel: configuration.verboseLogging ? .debug : .silent)
119
- try FileManager . default. removeItem ( at : helperFileUrl )
119
+ try FileManager . default. removeItem ( atPath : helperFilePath )
120
120
121
121
// write the generated SAM deployment decsriptor to disk
122
- let samDeploymentDescriptorFileUrl = URL ( fileURLWithPath: samDeploymentDescriptorFilePath)
123
- try samDeploymentDescriptor. write (
124
- to: samDeploymentDescriptorFileUrl, atomically: true , encoding: . utf8)
122
+ FileManager . default. createFile ( atPath: samDeploymentDescriptorFilePath,
123
+ contents: samDeploymentDescriptor. data ( using: . utf8) )
125
124
verboseLogging ? print ( " \( samDeploymentDescriptorFilePath) " ) : nil
126
125
127
126
} catch let error as DeployerPluginError {
0 commit comments