Creating Nimble version info method.

This commit is contained in:
ruidajo 2022-07-25 17:15:30 -05:00
parent 18d6aca473
commit e5ea6e7fd8
2 changed files with 17 additions and 2 deletions

View File

@ -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

View File

@ -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 ]
]