Skip to content

Commit ddb5690

Browse files
authored
Merge pull request #1746 from gwenya/file-edit-ext
incus file edit extension
2 parents 9e90938 + 7d456f7 commit ddb5690

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/incus/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func (c *cmdFileEdit) Run(cmd *cobra.Command, args []string) error {
412412
}
413413

414414
// Create temp file
415-
f, err := os.CreateTemp("", "incus_file_edit_")
415+
f, err := os.CreateTemp("", fmt.Sprintf("incus_file_edit_*%s", filepath.Ext(args[0])))
416416
if err != nil {
417417
return fmt.Errorf(i18n.G("Unable to create a temporary file: %v"), err)
418418
}

0 commit comments

Comments
 (0)