Compare commits
No commits in common. "a264070d5ce858580e2366862398795467718769" and "3a2d09602527280b20f93eb0386a0f09cfde9b21" have entirely different histories.
a264070d5c
...
3a2d096025
@ -33,16 +33,12 @@ YQ class >> jsonToYaml: aDictionary [
|
|||||||
| jsonFile |
|
| jsonFile |
|
||||||
self binaryFile exists ifFalse: [ YQ install].
|
self binaryFile exists ifFalse: [ YQ install].
|
||||||
jsonFile := MarkupFile exportAsFileOn: FileLocator temp / 'data.json' containing: aDictionary.
|
jsonFile := MarkupFile exportAsFileOn: FileLocator temp / 'data.json' containing: aDictionary.
|
||||||
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ])
|
OSSUnixSubprocess new
|
||||||
ifTrue: [
|
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
||||||
OSSUnixSubprocess new
|
redirectStdout;
|
||||||
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
runAndWaitOnExitDo: [ :command :outString |
|
||||||
redirectStdout;
|
^ outString
|
||||||
runAndWaitOnExitDo: [ :command :outString |
|
].
|
||||||
^ outString
|
|
||||||
]].
|
|
||||||
Smalltalk os isWindows
|
|
||||||
ifTrue: [ ^ LibC resultOfCommand: 'yq -p=json ', jsonFile fullName ].
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
Loading…
Reference in New Issue
Block a user