Adding Nim and NanoID support to Windows platform.
This commit is contained in:
parent
7979007091
commit
9ae7a6ec62
@ -28,6 +28,8 @@ NanoID class >> binaryFile [
|
|||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
NanoID class >> generate [
|
NanoID class >> generate [
|
||||||
self binaryFile exists ifFalse: [ NanoID install].
|
self binaryFile exists ifFalse: [ NanoID install].
|
||||||
|
Smalltalk os isWindows
|
||||||
|
ifTrue: [ ^ (LibC resultOfCommand:self binaryFile fullName) copyWithoutAll: (Character lf asString) ].
|
||||||
OSSUnixSubprocess new
|
OSSUnixSubprocess new
|
||||||
command: self binaryFile fullName;
|
command: self binaryFile fullName;
|
||||||
redirectStdout;
|
redirectStdout;
|
||||||
@ -41,6 +43,8 @@ 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."
|
||||||
self binaryFile exists ifTrue: [ ^ MiniDocs appFolder ].
|
self binaryFile exists ifTrue: [ ^ MiniDocs appFolder ].
|
||||||
Nimble install: 'nanoid'.
|
Nimble install: 'nanoid'.
|
||||||
|
Smalltalk os isWindows
|
||||||
|
ifTrue: [ ^ LibC resultOfCommand: 'nanoid c ',self scriptSourceCode fullName ].
|
||||||
OSSUnixSubprocess new
|
OSSUnixSubprocess new
|
||||||
command: 'nim';
|
command: 'nim';
|
||||||
arguments: {'c'. self scriptSourceCode fullName};
|
arguments: {'c'. self scriptSourceCode fullName};
|
||||||
|
@ -20,6 +20,8 @@ Nimble class >> detect: packageName [
|
|||||||
Nimble class >> install: packageName [
|
Nimble class >> install: packageName [
|
||||||
(self detect: packageName) ifTrue: [ ^ self ].
|
(self detect: packageName) ifTrue: [ ^ self ].
|
||||||
self installPackagesList.
|
self installPackagesList.
|
||||||
|
Smalltalk os isWindows
|
||||||
|
ifTrue: [ ^ LibC runCommand: 'nimble install ', packageName ].
|
||||||
OSSUnixSubprocess new
|
OSSUnixSubprocess new
|
||||||
command: 'nimble';
|
command: 'nimble';
|
||||||
arguments: {'install'.
|
arguments: {'install'.
|
||||||
@ -41,11 +43,16 @@ Nimble class >> installPackagesList [
|
|||||||
|
|
||||||
(FileLocator home / '.nimble' / 'packages_official.json') exists
|
(FileLocator home / '.nimble' / 'packages_official.json') exists
|
||||||
ifTrue: [ ^ self ].
|
ifTrue: [ ^ self ].
|
||||||
|
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ])
|
||||||
|
ifTrue: [
|
||||||
OSSUnixSubprocess new
|
OSSUnixSubprocess new
|
||||||
command: 'nimble';
|
command: 'nimble';
|
||||||
arguments: #('refresh');
|
arguments: #('refresh');
|
||||||
redirectStdout;
|
redirectStdout;
|
||||||
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
|
runAndWaitOnExitDo: [ :process :outString | ^ outString ].
|
||||||
|
].
|
||||||
|
Smalltalk os isWindows
|
||||||
|
ifTrue: [ ^ LibC resultOfCommand: 'nimble refresh' ]
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
Loading…
Reference in New Issue
Block a user