Compare commits
2 Commits
3a2d096025
...
a264070d5c
Author | SHA1 | Date | |
---|---|---|---|
a264070d5c | |||
642712cdfd |
@ -33,12 +33,16 @@ 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 ])
|
||||||
|
ifTrue: [
|
||||||
OSSUnixSubprocess new
|
OSSUnixSubprocess new
|
||||||
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
||||||
redirectStdout;
|
redirectStdout;
|
||||||
runAndWaitOnExitDo: [ :command :outString |
|
runAndWaitOnExitDo: [ :command :outString |
|
||||||
^ 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