From 873bc05d18e713ba79e38dcb1b81a9f9cf38de68 Mon Sep 17 00:00:00 2001 From: isc-tleavitt <73311181+isc-tleavitt@users.noreply.github.com> Date: Thu, 1 Sep 2022 14:22:29 -0400 Subject: [PATCH] Copy to proper directory Files were going into working directory because GetTargetDirectory() also calls $System.CSP.GetFileName. --- CHANGELOG.md | 2 +- cls/pkg/isc/ipm/js/base/processor.cls | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 } } -