diff --git a/src/MiniDocs/NanoID.class.st b/src/MiniDocs/NanoID.class.st index 8466b8d..1d3f21b 100644 --- a/src/MiniDocs/NanoID.class.st +++ b/src/MiniDocs/NanoID.class.st @@ -29,6 +29,7 @@ NanoID class >> install [ IMPORTANT: Nimble, Nim's package manager should be installed, as this process doesn't verify its proper installation." | binaryFileFolder | binaryFileFolder := self binaryFile parent. + binaryFileFolder exists ifFalse: [ binaryFileFolder ensureCreateDirectory ]. self binaryFile exists ifTrue: [ ^ binaryFileFolder ]. Nimble install: 'nanoid'. OSSUnixSubprocess new diff --git a/src/MiniDocs/Nimble.class.st b/src/MiniDocs/Nimble.class.st index ae47263..723b101 100644 --- a/src/MiniDocs/Nimble.class.st +++ b/src/MiniDocs/Nimble.class.st @@ -34,6 +34,20 @@ Nimble class >> installed [ command: 'nimble'; arguments: #('list' '--installed'); redirectStdout; - runAndWaitOnExitDo: [ :command :outString | installed := outString ]. - ^ installed lines + redirectStderr; + runAndWaitOnExitDo: [ :process :outString :errString | + process isSuccess + ifTrue: [ ^ outString lines ]; + ifFalse: [ ^ nil ] + ] +] + +{ #category : #accessing } +Nimble class >> version [ + + OSSUnixSubprocess new + command: 'nimble'; + arguments: #('--version'); + redirectStdout; + runAndWaitOnExitDo: [ :process :outString | ^ outString ] ]