Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve banner display in interactive zpm shell #684

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #682 When downloading IPM via the `enable` command from a remote registry, allow user to pass in the registry name (or get the only existent one), instead of the deployment enabled registry.

### Fixed
- #684 Fixed banner display issues in interactive `zpm` shell.
- #682 When enabling IPM in a namespace using local IPM caches, check for existence of `<iris-root>/lib/ipm/` beforing querying it.
- #682 Use more standard wording of mapping when enabling IPM
- #681 Convert specified namespaces to upper case for `enable` and `unmap` commands.
Expand Down
16 changes: 11 additions & 5 deletions src/cls/IPM/Main.cls
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,15 @@ ClassMethod ShellInternal(pCommand As %String, Output pException As %Exception.A
Set tOneCommand = 1
}
do ##class(%IPM.Main).GetVersion("zpm",.out)
If $Get(out) = "" {
Set registryInfo = $$$FormattedLine($$$Cyan, "No registry configured")
} Else {
Set registryInfo = "Current registry "_$$$FormattedLine($$$Cyan, out)
}
Set introMessageList = $ListBuild(
"Welcome to the Package Manager Shell (ZPM). Version: "_$$$FormattedLine($$$Green, ..GetVersionModule("zpm")),
"Enter q/quit to exit the shell. Enter ?/help to view available commands",
"Current registry "_$$$FormattedLine($$$Cyan,$g(out))
registryInfo
)
Set tInShell = 0
For {
Expand Down Expand Up @@ -1204,11 +1209,12 @@ ClassMethod GetVersionModule(name, namespace = {$namespace})
{
New $Namespace
Set $Namespace=namespace
Do ..GetListModules(name,.list)
If $Data(list(name)) {
quit $ListGet(list(name),1)
Try {
Do ..GetListModules(,name,.list)
Return $ListGet(list(1), 2)
} Catch ex {
Return ""
}
quit ""
}

/// @API.Method
Expand Down
Loading