From 22b1859d37d1781b37b8fdcbcce836d08d96c80c Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Thu, 22 Aug 2024 17:12:43 -0500 Subject: [PATCH] Migrating functinoality from OSSubprocess to GtSubprocess. --- src/ExoRepo/Nimble.class.st | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/ExoRepo/Nimble.class.st b/src/ExoRepo/Nimble.class.st index 8896d48..6c6f2ea 100644 --- a/src/ExoRepo/Nimble.class.st +++ b/src/ExoRepo/Nimble.class.st @@ -34,16 +34,12 @@ Nimble class >> installPackagesList [ (FileLocator home / '.nimble' / 'packages_official.json') exists ifTrue: [ ^ self ]. - (Smalltalk os isUnix or: [ Smalltalk os isMacOS ]) - ifTrue: [ - OSSUnixSubprocess new - command: 'nimble'; - arguments: #('refresh'); - redirectStdout; - runAndWaitOnExitDo: [ :process :outString | ^ outString ]. - ]. Smalltalk os isWindows - ifTrue: [ ^ LibC resultOfCommand: 'nimble refresh' ] + ifTrue: [ ^ LibC resultOfCommand: 'nimble refresh' ]. + ^ (GtSubprocessWithInMemoryOutput new + shellCommand: 'nimble refresh'; + runAndWait; + stdout) ] { #category : #accessing } @@ -57,7 +53,7 @@ Nimble class >> installed [ output. ^ process stdout lines ]. - ^(GtSubprocessWithInMemoryOutput new + ^ (GtSubprocessWithInMemoryOutput new shellCommand: 'nimble list --installed'; runAndWait; stdout) @@ -66,9 +62,8 @@ Nimble class >> installed [ { #category : #accessing } Nimble class >> version [ - OSSUnixSubprocess new - command: 'nimble'; - arguments: #('--version'); - redirectStdout; - runAndWaitOnExitDo: [ :process :outString | ^ outString ] + ^ (GtSubprocessWithInMemoryOutput new + shellCommand: 'nimble --version'; + runAndWait; + stdout) ]