2022-04-02 00:49:39 +00:00
|
|
|
accessing
|
|
|
|
storeContents
|
|
|
|
|
2022-04-06 17:46:32 +00:00
|
|
|
| objectString directory tempFile oldFile dehidratated |
|
|
|
|
|
|
|
|
dehidratated := self copy.
|
2022-04-14 22:40:41 +00:00
|
|
|
dehidratated messages: nil.
|
2022-04-06 17:46:32 +00:00
|
|
|
objectString := STON toStringPretty: dehidratated.
|
2022-04-06 18:24:51 +00:00
|
|
|
directory := self folder ensureCreateDirectory.
|
|
|
|
oldFile := directory / 'profile', 'ston'.
|
2022-04-05 00:06:21 +00:00
|
|
|
|
|
|
|
oldFile exists ifFalse: [
|
|
|
|
^ MarkupFile exportAsFileOn: oldFile containing: objectString ].
|
|
|
|
|
|
|
|
tempFile := MarkupFile
|
|
|
|
exportAsFileOn: FileLocator temp / self userName, 'ston'
|
|
|
|
containing: objectString.
|
|
|
|
|
|
|
|
(tempFile contents hash hex = oldFile contents hash hex) ifFalse: [
|
|
|
|
oldFile copyTo: directory /
|
|
|
|
(oldFile basenameWithoutExtension , '-',
|
|
|
|
('-' join:((oldFile creationTime asLocalStringYMDHM) splitOn: ' ')),
|
|
|
|
'.ston').
|
|
|
|
oldFile ensureDelete.
|
|
|
|
^ { 'Profile changed' -> (tempFile moveTo: oldFile)} asDictionary ].
|
|
|
|
^ { 'Same Profile' -> oldFile } asDictionary.
|