Skip to content

Commit 0d517b5

Browse files
authored
Merge pull request #19 from intersystems-community/fixed_version
fixed version in api
2 parents 78df3be + 1bffbd4 commit 0d517b5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
**/.DS_Store
1+
**/.DS_Store
2+
.*

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ USER irisowner
1010
COPY Installer.cls SQLPriv.xml ./
1111
COPY src src
1212
COPY zpm-registry.yaml /usr/irissys/
13+
RUN VERSION=$(grep -oP '(?<=<Version>).*?(?=</Version>)' module.xml) && \
14+
sed -i "s/Parameter VERSION.*/Parameter VERSION = \"${VERSION}\";/" ./src/CLS/ZPM/Registry.cls
1315

1416
RUN \
1517
iris start ${ISC_PACKAGE_INSTANCENAME} && \

src/cls/ZPM/Registry.cls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Class ZPM.Registry Extends ZPM.REST.Base
33
{
44

5+
Parameter VERSION = "1.0.0";
6+
57
XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
68
{
79
<Routes>
@@ -50,7 +52,13 @@ XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
5052
/// Package Manager general information
5153
ClassMethod GetInfo() As %Status
5254
{
53-
SET version = $get(^RegistryVersion, "0.0.2")
55+
SET version = ..#VERSION
56+
If $System.CLS.IsMthd("%ZPM.PackageManager.Developer.Module", "NameOpen") {
57+
Set zpmModule = ##class(%ZPM.PackageManager.Developer.Module).NameOpen("zpm-registry")
58+
If $IsObject(zpmModule) {
59+
Set version = zpmModule.VersionString
60+
}
61+
}
5462
SET info = {
5563
"version": (version)
5664
}

0 commit comments

Comments
 (0)