diff --git a/Sources/ContainerCommands/Image/ImageLoad.swift b/Sources/ContainerCommands/Image/ImageLoad.swift index 08e66d4f7..9901c6ca6 100644 --- a/Sources/ContainerCommands/Image/ImageLoad.swift +++ b/Sources/ContainerCommands/Image/ImageLoad.swift @@ -18,6 +18,7 @@ import ArgumentParser import ContainerAPIClient import Containerization import ContainerizationError +import ContainerizationOS import Foundation import SystemPackage import TerminalProgress @@ -33,11 +34,7 @@ extension Application { @Option( name: .shortAndLong, help: "Path to the image tar archive", completion: .file(), transform: { str in - let path = FilePath(str) - guard path.isRelative else { return path.lexicallyNormalized() } - return FilePath(FileManager.default.currentDirectoryPath) - .pushing(path) - .lexicallyNormalized() + FilePathOps.absolutePath(FilePath(str)) }) var input: FilePath? diff --git a/Sources/ContainerCommands/Image/ImageSave.swift b/Sources/ContainerCommands/Image/ImageSave.swift index c514f5c68..4d1e7f4e8 100644 --- a/Sources/ContainerCommands/Image/ImageSave.swift +++ b/Sources/ContainerCommands/Image/ImageSave.swift @@ -22,6 +22,7 @@ import ContainerResource import Containerization import ContainerizationError import ContainerizationOCI +import ContainerizationOS import Foundation import SystemPackage import TerminalProgress @@ -48,11 +49,7 @@ extension Application { @Option( name: .shortAndLong, help: "Pathname for the saved image", completion: .file(), transform: { str in - let path = FilePath(str) - guard path.isRelative else { return path.lexicallyNormalized() } - return FilePath(FileManager.default.currentDirectoryPath) - .pushing(path) - .lexicallyNormalized() + FilePathOps.absolutePath(FilePath(str)) }) var output: FilePath?