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." IMPORTANT: Nimble, Nim's package manager should be installed, as this process doesn't verify its proper installation."
| binaryFileFolder | | binaryFileFolder |
binaryFileFolder := self binaryFile parent. binaryFileFolder := self binaryFile parent.
binaryFileFolder exists ifFalse: [ binaryFileFolder ensureCreateDirectory ].
self binaryFile exists ifTrue: [ ^ binaryFileFolder ]. self binaryFile exists ifTrue: [ ^ binaryFileFolder ].
Nimble install: 'nanoid'. Nimble install: 'nanoid'.
OSSUnixSubprocess new OSSUnixSubprocess new

View File

@ -34,6 +34,20 @@ Nimble class >> installed [
command: 'nimble'; command: 'nimble';
arguments: #('list' '--installed'); arguments: #('list' '--installed');
redirectStdout; redirectStdout;
runAndWaitOnExitDo: [ :command :outString | installed := outString ]. redirectStderr;
^ installed lines 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 ]
] ]