Merge cdac1e3af7
This commit is contained in:
commit
3ef2289bbe
@ -1,5 +1,5 @@
|
|||||||
accessing
|
accessing
|
||||||
exportWithTemplate: mustacheFile On: folder
|
exportWithTemplate: mustacheFile into: folder
|
||||||
|
|
||||||
| tempDictionary modified |
|
| tempDictionary modified |
|
||||||
tempDictionary := self asDictionary copy.
|
tempDictionary := self asDictionary copy.
|
@ -1,6 +1,23 @@
|
|||||||
accessing
|
accessing
|
||||||
storeContents
|
storeContents
|
||||||
|
|
||||||
| objectString |
|
| objectString directory tempFile oldFile |
|
||||||
objectString := STON toStringPretty: self.
|
objectString := STON toStringPretty: self.
|
||||||
^ MarkupFile exportAsFileOn: self folder/ self userName, 'ston' containing: objectString.
|
directory := (FileLocator userData / 'Socialmetrica' / self userName) ensureCreateDirectory.
|
||||||
|
oldFile := directory / self userName, 'ston'.
|
||||||
|
|
||||||
|
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.
|
Loading…
Reference in New Issue
Block a user