-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tart pull: experimental --json-digest option * Introduce "tart fqn" command * Revert "tart pull: experimental --json-digest option" This reverts commit 842052f.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import ArgumentParser | ||
import Foundation | ||
import SystemConfiguration | ||
|
||
struct FQN: AsyncParsableCommand { | ||
static var configuration = CommandConfiguration(abstract: "Get a fully-qualified VM name", shouldDisplay: false) | ||
|
||
@Argument(help: "VM name") | ||
var name: String | ||
|
||
func run() async throws { | ||
if var remoteName = try? RemoteName(name) { | ||
let digest = try VMStorageOCI().digest(remoteName) | ||
|
||
remoteName.reference = Reference(digest: digest) | ||
|
||
print(remoteName) | ||
} else { | ||
print(name) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters