Skip to content

Commit 201ccd7

Browse files
committed
remove last modified timestamp from PTD files after export
1 parent 3a375f0 commit 201ccd7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cls/SourceControl/Git/Production.cls

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@ ClassMethod ExportProjectForPTD(productionClass, ptdName, exportPath) As %Status
111111
set projContentsList(exportNotesPTDName_".PTD") = ""
112112
set projContentsList(project.Name_".PRJ") = ""
113113
$$$ThrowOnError($System.OBJ.Export(.projContentsList, exportPath, "/diffexport=1"))
114+
// remove the LastModified timestamp from the exported file
115+
set fileStream = ##class(%Stream.FileCharacter).%OpenId(exportPath,,.st)
116+
$$$ThrowOnError(st)
117+
set fileCopy = ##class(%Stream.TmpCharacter).%New()
118+
set timestampFound = 0
119+
while 'fileStream.AtEnd {
120+
set line = fileStream.ReadLine()
121+
set regex = ##class(%Regex.Matcher).%New("\<Project name="".*"" LastModified=""(.*)""\>")
122+
if 'timestampFound && regex.Match(line) {
123+
set timestampFound = 1
124+
set timestamp = regex.Group(1)
125+
set line = $replace(line, timestamp, "1841-01-01 00:00:00.0000000")
126+
}
127+
do fileCopy.WriteLine(line)
128+
}
129+
$$$ThrowOnError(fileStream.CopyFromAndSave(fileCopy))
114130
} catch err {
115131
set st = err.AsStatus()
116132
}

0 commit comments

Comments
 (0)