From d1bed250231e4786c5e2344282d8dbf2e5f38213 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Mon, 16 May 2022 01:03:15 +0300 Subject: [PATCH] tart pull: be more liberal when accepting local image as argument (#70) * tart pull: be more liberal when accepting local image as argument * Update Sources/tart/Commands/Pull.swift Co-authored-by: Fedor Korotkov * Single sentence and consistent capitalization Co-authored-by: Fedor Korotkov --- Sources/tart/Commands/Pull.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/tart/Commands/Pull.swift b/Sources/tart/Commands/Pull.swift index da1a111..b19e3de 100644 --- a/Sources/tart/Commands/Pull.swift +++ b/Sources/tart/Commands/Pull.swift @@ -10,6 +10,14 @@ struct Pull: AsyncParsableCommand { func run() async throws { do { + // Be more liberal when accepting local image as argument, + // see https://github.com/cirruslabs/tart/issues/36 + if VMStorageLocal().exists(remoteName) { + print("\"\(remoteName)\" is a local image, nothing to pull here!") + + Foundation.exit(0) + } + let remoteName = try RemoteName(remoteName) let registry = try Registry(host: remoteName.host, namespace: remoteName.namespace)