@@ -14,7 +14,7 @@ import (
14
14
)
15
15
16
16
// VERSION is the current gomason version
17
- const VERSION = "2.11.0 "
17
+ const VERSION = "2.11.1 "
18
18
19
19
// METADATA_FILENAME The default gomason metadata file name
20
20
const METADATA_FILENAME = "metadata.json"
@@ -277,21 +277,33 @@ func CollectFileAndSignature(cwd string, filename string) (err error) {
277
277
278
278
log .Printf ("[DEBUG] Collecting Binaries and Signatures (if signing)" )
279
279
280
- err = os .Rename (filename , binaryDestinationPath )
280
+ contents , err : = os .ReadFile (filename )
281
281
if err != nil {
282
- err = errors .Wrap (err , fmt .Sprintf ("failed to collect file %q" , filename ))
282
+ err = errors .Wrapf (err , "failed reading file %q" , filename )
283
+ return err
284
+ }
285
+
286
+ err = os .WriteFile (binaryDestinationPath , contents , 0644 )
287
+ if err != nil {
288
+ err = errors .Wrapf (err , "failed writing file %s" , binaryDestinationPath )
283
289
return err
284
290
}
285
291
286
292
sigName := fmt .Sprintf ("%s.asc" , filepath .Base (filename ))
287
293
if _ , err := os .Stat (sigName ); ! os .IsNotExist (err ) {
288
294
signatureDestinationPath := fmt .Sprintf ("%s/%s" , cwd , sigName )
295
+ contents , err := os .ReadFile (filename )
296
+ if err != nil {
297
+ err = errors .Wrapf (err , "failed reading file %q" , filename )
298
+ return err
299
+ }
289
300
290
- err = os .Rename ( sigName , signatureDestinationPath )
301
+ err = os .WriteFile ( signatureDestinationPath , contents , 0644 )
291
302
if err != nil {
292
- err = errors .Wrap (err , fmt . Sprintf ( "failed to collect signature %q " , sigName ) )
303
+ err = errors .Wrapf (err , "failed writing file %s " , signatureDestinationPath )
293
304
return err
294
305
}
306
+
295
307
}
296
308
297
309
return err
0 commit comments