firefly-compiler 0.4.62 → 0.4.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/NodeSystem.ff +13 -28
- package/output/js/ff/core/NodeSystem.mjs +24 -26
- package/package.json +1 -1
- package/vscode/package.json +1 -1
package/core/NodeSystem.ff
CHANGED
|
@@ -106,7 +106,7 @@ extend self: NodeSystem {
|
|
|
106
106
|
environment: Option[Map[String, String]] = None
|
|
107
107
|
maxBuffer: Int = 16777216
|
|
108
108
|
killSignal: Int = 9
|
|
109
|
-
|
|
109
|
+
windowsWhere: Bool = True
|
|
110
110
|
): ProcessResult
|
|
111
111
|
target node async """
|
|
112
112
|
import * as childProcess from 'node:child_process';
|
|
@@ -118,9 +118,9 @@ extend self: NodeSystem {
|
|
|
118
118
|
ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
|
-
if(
|
|
121
|
+
if(windowsWhere_ && process.platform === 'win32') {
|
|
122
122
|
command_ =
|
|
123
|
-
(await
|
|
123
|
+
(await internalWindowsWhere_$(self_, command_, workingDirectory_, environment_, $task)).value_ ||
|
|
124
124
|
command_;
|
|
125
125
|
}
|
|
126
126
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
@@ -201,36 +201,21 @@ internalFindCommand(out: String): String {
|
|
|
201
201
|
}.else {""}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
|
|
205
|
-
target node sync """
|
|
206
|
-
return process.platform === 'win32';
|
|
207
|
-
"""
|
|
208
|
-
|
|
209
|
-
internalWhich(
|
|
204
|
+
internalWindowsWhere(
|
|
210
205
|
system: NodeSystem
|
|
211
206
|
command: String
|
|
212
207
|
workingDirectory: Option[Path] = None
|
|
213
208
|
environment: Option[Map[String, String]] = None
|
|
214
209
|
): Option[String] {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
} else {
|
|
224
|
-
system.execute(
|
|
225
|
-
"which",
|
|
226
|
-
[command],
|
|
227
|
-
workingDirectory = workingDirectory
|
|
228
|
-
environment = environment
|
|
229
|
-
windowsWhich = False
|
|
230
|
-
)
|
|
231
|
-
}
|
|
210
|
+
if(!command.all {c => c.isAsciiLetterOrDigit() || c == '_' || c == '-'}) {None} else:
|
|
211
|
+
let out = system.execute(
|
|
212
|
+
"cmd.exe",
|
|
213
|
+
["/c", "where", command],
|
|
214
|
+
workingDirectory = workingDirectory
|
|
215
|
+
environment = environment
|
|
216
|
+
windowsWhere = False
|
|
217
|
+
)
|
|
232
218
|
out.standardOut.toString().lines().filter {line =>
|
|
233
|
-
out.exitCode == 0 &&
|
|
234
|
-
(!internalIsWindows() || line.split('\\').last().any {_.contains(".")})
|
|
219
|
+
out.exitCode == 0 && line.split('\\').last().any {_.contains(".")}
|
|
235
220
|
}.first()
|
|
236
221
|
}
|
|
@@ -136,22 +136,20 @@ return ""
|
|
|
136
136
|
}))
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
export function
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const out_ = (ff_core_NodeSystem.internalIsWindows_()
|
|
147
|
-
? ff_core_NodeSystem.NodeSystem_execute(system_, "cmd.exe", ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false)
|
|
148
|
-
: ff_core_NodeSystem.NodeSystem_execute(system_, "which", [command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false));
|
|
139
|
+
export function internalWindowsWhere_(system_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None()) {
|
|
140
|
+
if((!ff_core_String.String_all(command_, ((c_) => {
|
|
141
|
+
return ((ff_core_Char.Char_isAsciiLetterOrDigit(c_) || (c_ === 95)) || (c_ === 45))
|
|
142
|
+
})))) {
|
|
143
|
+
return ff_core_Option.None()
|
|
144
|
+
} else {
|
|
145
|
+
const out_ = ff_core_NodeSystem.NodeSystem_execute(system_, "cmd.exe", ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false);
|
|
149
146
|
return ff_core_List.List_first(ff_core_List.List_filter(ff_core_String.String_lines(ff_core_Buffer.Buffer_toString(out_.standardOut_, "utf8")), ((line_) => {
|
|
150
|
-
return ((out_.exitCode_ === 0) &&
|
|
147
|
+
return ((out_.exitCode_ === 0) && ff_core_Option.Option_any(ff_core_List.List_last(ff_core_String.String_split(line_, 92)), ((_w1) => {
|
|
151
148
|
return ff_core_String.String_contains(_w1, ".")
|
|
152
|
-
})))
|
|
149
|
+
})))
|
|
153
150
|
})))
|
|
154
151
|
}
|
|
152
|
+
}
|
|
155
153
|
|
|
156
154
|
export async function internalAssets_$(system_, $task) {
|
|
157
155
|
return system_.assets_
|
|
@@ -183,19 +181,19 @@ return ""
|
|
|
183
181
|
}))
|
|
184
182
|
}
|
|
185
183
|
|
|
186
|
-
export async function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
: (await ff_core_NodeSystem.NodeSystem_execute$(system_, "which", [command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false, $task)));
|
|
184
|
+
export async function internalWindowsWhere_$(system_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), $task) {
|
|
185
|
+
if((!ff_core_String.String_all(command_, ((c_) => {
|
|
186
|
+
return ((ff_core_Char.Char_isAsciiLetterOrDigit(c_) || (c_ === 95)) || (c_ === 45))
|
|
187
|
+
})))) {
|
|
188
|
+
return ff_core_Option.None()
|
|
189
|
+
} else {
|
|
190
|
+
const out_ = (await ff_core_NodeSystem.NodeSystem_execute$(system_, "cmd.exe", ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false, $task));
|
|
194
191
|
return ff_core_List.List_first(ff_core_List.List_filter(ff_core_String.String_lines(ff_core_Buffer.Buffer_toString(out_.standardOut_, "utf8")), ((line_) => {
|
|
195
|
-
return ((out_.exitCode_ === 0) &&
|
|
192
|
+
return ((out_.exitCode_ === 0) && ff_core_Option.Option_any(ff_core_List.List_last(ff_core_String.String_split(line_, 92)), ((_w1) => {
|
|
196
193
|
return ff_core_String.String_contains(_w1, ".")
|
|
197
|
-
}))))
|
|
198
194
|
})))
|
|
195
|
+
})))
|
|
196
|
+
}
|
|
199
197
|
}
|
|
200
198
|
|
|
201
199
|
export function NodeSystem_arguments(self_) {
|
|
@@ -294,7 +292,7 @@ export function NodeSystem_environment(self_) {
|
|
|
294
292
|
throw new Error('Function NodeSystem_environment is missing on this target in sync context.');
|
|
295
293
|
}
|
|
296
294
|
|
|
297
|
-
export function NodeSystem_execute(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9,
|
|
295
|
+
export function NodeSystem_execute(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsWhere_ = true) {
|
|
298
296
|
throw new Error('Function NodeSystem_execute is missing on this target in sync context.');
|
|
299
297
|
}
|
|
300
298
|
|
|
@@ -408,7 +406,7 @@ export async function NodeSystem_environment$(self_, $task) {
|
|
|
408
406
|
|
|
409
407
|
}
|
|
410
408
|
|
|
411
|
-
export async function NodeSystem_execute$(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9,
|
|
409
|
+
export async function NodeSystem_execute$(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsWhere_ = true, $task) {
|
|
412
410
|
|
|
413
411
|
const childProcess = import$3;
|
|
414
412
|
const environment = environment_.value_ !== void 0 ? {} : process.env;
|
|
@@ -419,9 +417,9 @@ export async function NodeSystem_execute$(self_, command_, arguments_, standardI
|
|
|
419
417
|
ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String
|
|
420
418
|
);
|
|
421
419
|
}
|
|
422
|
-
if(
|
|
420
|
+
if(windowsWhere_ && process.platform === 'win32') {
|
|
423
421
|
command_ =
|
|
424
|
-
(await
|
|
422
|
+
(await internalWindowsWhere_$(self_, command_, workingDirectory_, environment_, $task)).value_ ||
|
|
425
423
|
command_;
|
|
426
424
|
}
|
|
427
425
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
package/package.json
CHANGED