Using GtSubprocess instead of OSSubprocess. Will backporting this to "plain" Pharo be a future issue?
This commit is contained in:
parent
c01d31a2a9
commit
5de6a81029
@ -42,16 +42,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 ])
|
|
||||||
ifTrue: [
|
|
||||||
OSSUnixSubprocess new
|
|
||||||
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
|
||||||
redirectStdout;
|
|
||||||
runAndWaitOnExitDo: [ :command :outString |
|
|
||||||
^ outString
|
|
||||||
]].
|
|
||||||
Smalltalk os isWindows
|
Smalltalk os isWindows
|
||||||
ifTrue: [ ^ LibC resultOfCommand: 'yq -p=json ', jsonFile fullName ].
|
ifTrue: [ ^ LibC resultOfCommand: 'yq -p=json ', jsonFile fullName ].
|
||||||
|
^ GtSubprocessWithInMemoryOutput new
|
||||||
|
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
||||||
|
runAndWait;
|
||||||
|
stdout
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
Loading…
Reference in New Issue
Block a user