firefly-compiler 0.4.63 → 0.4.64
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
CHANGED
|
@@ -119,9 +119,10 @@ extend self: NodeSystem {
|
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
if(windowsWhere_ && process.platform === 'win32') {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
command_
|
|
122
|
+
const cmd = process.env.ComSpec || "cmd.exe";
|
|
123
|
+
command_ = (
|
|
124
|
+
await internalWindowsWhere_$(self_, cmd, command_, workingDirectory_, environment_, $task)
|
|
125
|
+
).value_ || command_;
|
|
125
126
|
}
|
|
126
127
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
127
128
|
cwd: workingDirectory_.value_,
|
|
@@ -203,13 +204,14 @@ internalFindCommand(out: String): String {
|
|
|
203
204
|
|
|
204
205
|
internalWindowsWhere(
|
|
205
206
|
system: NodeSystem
|
|
207
|
+
cmd: String
|
|
206
208
|
command: String
|
|
207
209
|
workingDirectory: Option[Path] = None
|
|
208
210
|
environment: Option[Map[String, String]] = None
|
|
209
211
|
): Option[String] {
|
|
210
212
|
if(!command.all {c => c.isAsciiLetterOrDigit() || c == '_' || c == '-'}) {None} else:
|
|
211
213
|
let out = system.execute(
|
|
212
|
-
|
|
214
|
+
cmd,
|
|
213
215
|
["/c", "where", command],
|
|
214
216
|
workingDirectory = workingDirectory
|
|
215
217
|
environment = environment
|
|
@@ -136,13 +136,13 @@ return ""
|
|
|
136
136
|
}))
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
export function internalWindowsWhere_(system_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None()) {
|
|
139
|
+
export function internalWindowsWhere_(system_, cmd_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None()) {
|
|
140
140
|
if((!ff_core_String.String_all(command_, ((c_) => {
|
|
141
141
|
return ((ff_core_Char.Char_isAsciiLetterOrDigit(c_) || (c_ === 95)) || (c_ === 45))
|
|
142
142
|
})))) {
|
|
143
143
|
return ff_core_Option.None()
|
|
144
144
|
} else {
|
|
145
|
-
const out_ = ff_core_NodeSystem.NodeSystem_execute(system_,
|
|
145
|
+
const out_ = ff_core_NodeSystem.NodeSystem_execute(system_, cmd_, ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false);
|
|
146
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_) => {
|
|
147
147
|
return ((out_.exitCode_ === 0) && ff_core_Option.Option_any(ff_core_List.List_last(ff_core_String.String_split(line_, 92)), ((_w1) => {
|
|
148
148
|
return ff_core_String.String_contains(_w1, ".")
|
|
@@ -181,13 +181,13 @@ return ""
|
|
|
181
181
|
}))
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
export async function internalWindowsWhere_$(system_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), $task) {
|
|
184
|
+
export async function internalWindowsWhere_$(system_, cmd_, command_, workingDirectory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), $task) {
|
|
185
185
|
if((!ff_core_String.String_all(command_, ((c_) => {
|
|
186
186
|
return ((ff_core_Char.Char_isAsciiLetterOrDigit(c_) || (c_ === 95)) || (c_ === 45))
|
|
187
187
|
})))) {
|
|
188
188
|
return ff_core_Option.None()
|
|
189
189
|
} else {
|
|
190
|
-
const out_ = (await ff_core_NodeSystem.NodeSystem_execute$(system_,
|
|
190
|
+
const out_ = (await ff_core_NodeSystem.NodeSystem_execute$(system_, cmd_, ["/c", "where", command_], ff_core_Buffer.new_(0, false), workingDirectory_, environment_, 16777216, 9, false, $task));
|
|
191
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_) => {
|
|
192
192
|
return ((out_.exitCode_ === 0) && ff_core_Option.Option_any(ff_core_List.List_last(ff_core_String.String_split(line_, 92)), ((_w1) => {
|
|
193
193
|
return ff_core_String.String_contains(_w1, ".")
|
|
@@ -418,9 +418,10 @@ export async function NodeSystem_execute$(self_, command_, arguments_, standardI
|
|
|
418
418
|
);
|
|
419
419
|
}
|
|
420
420
|
if(windowsWhere_ && process.platform === 'win32') {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
command_
|
|
421
|
+
const cmd = process.env.ComSpec || "cmd.exe";
|
|
422
|
+
command_ = (
|
|
423
|
+
await internalWindowsWhere_$(self_, cmd, command_, workingDirectory_, environment_, $task)
|
|
424
|
+
).value_ || command_;
|
|
424
425
|
}
|
|
425
426
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
426
427
|
cwd: workingDirectory_.value_,
|
package/package.json
CHANGED