From 8ad6c73f4579033bf8be8cd284fc3bc9d6fe59ab Mon Sep 17 00:00:00 2001 From: Offray Date: Mon, 9 Sep 2024 19:43:02 -0500 Subject: [PATCH] New Fossil class using GtSubProcessInMemory. --- repository/Fossil/Fossil.class.st | 16 ++++++++++++++++ repository/Fossil/FossilRepo.class.st | 12 +++++------- 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 repository/Fossil/Fossil.class.st diff --git a/repository/Fossil/Fossil.class.st b/repository/Fossil/Fossil.class.st new file mode 100644 index 0000000..6383272 --- /dev/null +++ b/repository/Fossil/Fossil.class.st @@ -0,0 +1,16 @@ +Class { + #name : #Fossil, + #superclass : #Object, + #category : #Fossil +} + +{ #category : #accessing } +Fossil class >> all: subcommand [ + + Smalltalk os isWindows ifTrue: [ ^ self shouldBeImplemented ]. + ^ GtSubprocessWithInMemoryOutput new + shellCommand: 'fossil all ', subcommand; + runAndWait; + stdout + +] diff --git a/repository/Fossil/FossilRepo.class.st b/repository/Fossil/FossilRepo.class.st index 39e2293..76871fb 100644 --- a/repository/Fossil/FossilRepo.class.st +++ b/repository/Fossil/FossilRepo.class.st @@ -48,13 +48,11 @@ FossilRepo class >> local: aFilePath repository: aFossilFilePath [ { #category : #accessing } FossilRepo class >> locateExecutable [ - Smalltalk os isWindows ifTrue: [ ^ self ]. - OSSUnixSubprocess new - command: 'which'; - arguments: #('fossil') ; - redirectStdout; - runAndWaitOnExitDo: [ :process :outString | - ^ outString allButLast ] + Smalltalk os isWindows ifTrue: [ ^ MiniDocs shouldBeImplemented ]. + ^ (GtSubprocessWithInMemoryOutput new + shellCommand: 'which fossil'; + runAndWait; + stdout) lines first ] { #category : #operation }