From b4007d6be06d158295916d6dff4c86bce9d088ee Mon Sep 17 00:00:00 2001 From: saehejkang <20051028+saehejkang@users.noreply.github.com> Date: Fri, 22 May 2026 16:02:10 -0700 Subject: [PATCH] update image load/save to use FilePathOps --- Sources/ContainerCommands/Image/ImageLoad.swift | 7 ++----- Sources/ContainerCommands/Image/ImageSave.swift | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) 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 d1cab7965..150e1351c 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?