Skip to content

Commit 72a8ade

Browse files
authored
Merge pull request #680 from intersystems/v0.9.x-fix-export-static-files
fix: always export static files if existent
2 parents e29c5eb + ca04bd8 commit 72a8ade

File tree

7 files changed

+48
-4
lines changed

7 files changed

+48
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
98
## [Unreleased - 0.9.2+snapshot]
109
### Fixed
1110
- #681 Convert specified namespaces to upper case for `enable` and `unmap` commands.
11+
- #680 Always export static files (README.md, LICENSE, requirements.txt) if existent
1212

1313
## [0.9.1] - 2024-12-18
1414

src/cls/IPM/Lifecycle/Base.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,9 +1184,9 @@ Method %Export(ByRef pParams, ByRef pTargetDirectory As %String, Output pDepende
11841184
}
11851185
/// Always keep these files
11861186
Set staticFiles = $ListBuild(
1187-
// "readme.md",
1188-
// "license",
1189-
// "requirements.txt",
1187+
"readme.md",
1188+
"license",
1189+
"requirements.txt",
11901190
)
11911191
Set tRes = ##class(%File).FileSetFunc(..Module.Root)
11921192
While tRes.%Next() {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Include %IPM.Common
2+
3+
Class Test.PM.Integration.StaticFileExport Extends Test.PM.Integration.Base
4+
{
5+
6+
Method TestWSGIApp()
7+
{
8+
Set tSC = $$$OK
9+
Try {
10+
Set tTestRoot = ##class(%File).NormalizeDirectory($Get(^UnitTestRoot))
11+
set tModuleDir = ##class(%File).NormalizeDirectory(##class(%File).GetDirectory(tTestRoot)_"/_data/static-file-export-test/")
12+
Set tSC = ##class(%IPM.Main).Shell("load -verbose " _ tModuleDir)
13+
Do $$$AssertStatusOK(tSC,"Module successfully. " _ tModuleDir)
14+
Set exportDir = ##class(%File).NormalizeDirectory($$$FileTempDirSys)
15+
Set tSC = ##class(%IPM.Main).Shell("static-file-export-test package -DPath="_exportDir)
16+
Do $$$AssertStatusOK(tSC,"Exported to directory " _ exportDir _ " successfully.")
17+
Do $$$AssertTrue(##class(%File).DirectoryExists(exportDir))
18+
For file = "LICENSE","README.md","requirements.txt" {
19+
Set tFile = ##class(%File).NormalizeFilename(file, exportDir)
20+
If '$$$AssertTrue(##class(%File).Exists(tFile)) {
21+
Do $$$LogMessage("File "_tFile_" does not exist.")
22+
}
23+
}
24+
} Catch e {
25+
Do $$$AssertStatusOK(e.AsStatus(), "An exception occurred.")
26+
}
27+
}
28+
29+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a license
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a readme
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Export generator="Cache" version="25">
3+
<Document name="static-file-export-test.ZPM">
4+
<Module>
5+
<Name>static-file-export-test</Name>
6+
<Version>1.0.0</Version>
7+
<Description>Test whether static files (readme.md, licence, requirements.txt) are properly exported</Description>
8+
<Packaging>module</Packaging>
9+
<AfterInstallMessage>Module installed successfully!</AfterInstallMessage>
10+
</Module>
11+
</Document>
12+
</Export>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests

0 commit comments

Comments
 (0)