mirror of
https://github.com/apple/container.git
synced 2026-08-24 10:05:43 -05:00
Allow kernel set with tar to use relative paths to tar file (#582)
## Type of Change - [x] Bug fix ## Description Allow kernel set with tar to use relative paths to tar file. Fixes https://github.com/apple/container/issues/573. ## Motivation and Context `absoluteString` will prefix a scheme to the file path that looks like "file://". This will cause file manager to fail to find the file at the file path even if it exists. Change to instead just get the `path` of the file, which does not add a scheme prefix. ## Testing - [x] Tested locally Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
@@ -77,7 +77,7 @@ extension Application {
|
||||
throw ArgumentParser.ValidationError("Missing argument '--tar")
|
||||
}
|
||||
let platform = try getSystemPlatform()
|
||||
let localTarPath = URL(fileURLWithPath: tarPath, relativeTo: .currentDirectory()).absoluteString
|
||||
let localTarPath = URL(fileURLWithPath: tarPath, relativeTo: .currentDirectory()).path
|
||||
let fm = FileManager.default
|
||||
if fm.fileExists(atPath: localTarPath) {
|
||||
try await ClientKernel.installKernelFromTar(tarFile: localTarPath, kernelFilePath: binaryPath, platform: platform, force: force)
|
||||
|
||||
Reference in New Issue
Block a user