diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0b6bd..3399c72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ### Fixed -- +- Web application files are copied to proper target, not the current working directory ### Security - diff --git a/cls/pkg/isc/ipm/js/base/processor.cls b/cls/pkg/isc/ipm/js/base/processor.cls index 7513c66..c65efd7 100644 --- a/cls/pkg/isc/ipm/js/base/processor.cls +++ b/cls/pkg/isc/ipm/js/base/processor.cls @@ -29,7 +29,11 @@ Method OnBeforePhase(pPhase As %String, ByRef pParams) As %Status } ElseIf (pPhase = "Activate") { // Move files to the right place. Set sourceDir = ##class(%Library.File).NormalizeDirectory(..GetSourceDirectory()) - Set targetDir = $System.CSP.GetFileName(..GetTargetDirectory()) + Set targetDir = ..GetTargetDirectory() + If (targetDir = "") { + // Should never happen, but good to be safe (and avoid using working directory) + $$$ThrowStatus($$$ERROR($$$GeneralError,"Target directory not specified.")) + } Set testFile = sourceDir_"index.html" If '##class(%Library.File).Exists(testFile) { $$$ThrowStatus($$$ERROR($$$GeneralError,$$$FormatText("File '%1' does not exist; will not activate %2 UI changes.",testFile,..#FLAVOR))) @@ -412,4 +416,3 @@ ClassMethod SanitizeWebAppBase(base As %String) As %String } } -