Adding yq support to Windows platform.
This commit is contained in:
parent
6832d9024d
commit
642712cdfd
@ -33,12 +33,16 @@ YQ class >> jsonToYaml: aDictionary [
|
||||
| jsonFile |
|
||||
self binaryFile exists ifFalse: [ YQ install].
|
||||
jsonFile := MarkupFile exportAsFileOn: FileLocator temp / 'data.json' containing: aDictionary.
|
||||
OSSUnixSubprocess new
|
||||
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
||||
redirectStdout;
|
||||
runAndWaitOnExitDo: [ :command :outString |
|
||||
^ outString
|
||||
].
|
||||
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ])
|
||||
ifTrue: [
|
||||
OSSUnixSubprocess new
|
||||
shellCommand: 'cat ', jsonFile fullName,' | yq -y';
|
||||
redirectStdout;
|
||||
runAndWaitOnExitDo: [ :command :outString |
|
||||
^ outString
|
||||
]].
|
||||
Smalltalk os isWindows
|
||||
ifTrue: [ ^ LibC resultOfCommand: 'yq -p=json ', jsonFile fullName ].
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user