firefly-compiler 0.4.63 → 0.4.65
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/bin/Release.ff +8 -8
- package/core/NodeSystem.ff +10 -8
- package/output/js/ff/core/NodeSystem.mjs +11 -10
- package/package.json +1 -1
- package/vscode/package.json +1 -1
package/bin/Release.ff
CHANGED
|
@@ -70,8 +70,8 @@ releaseFireflyPackage(
|
|
|
70
70
|
)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
requireNpmLoggedIn(system: NodeSystem,
|
|
74
|
-
let out = run(system, "npm", ["whoami"],
|
|
73
|
+
requireNpmLoggedIn(system: NodeSystem, directory: Path) {
|
|
74
|
+
let out = run(system, "npm", ["whoami"], directory)
|
|
75
75
|
if(out.exitCode != 0) {
|
|
76
76
|
system.writeErrorLine("")
|
|
77
77
|
system.writeErrorLine("You are not logged into npm")
|
|
@@ -80,8 +80,8 @@ requireNpmLoggedIn(system: NodeSystem, workingDirectory: Path) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
requireVsceLoggedIn(system: NodeSystem,
|
|
84
|
-
let out = runSuccessful(system, "vsce", ["ls-publishers"],
|
|
83
|
+
requireVsceLoggedIn(system: NodeSystem, directory: Path) {
|
|
84
|
+
let out = runSuccessful(system, "vsce", ["ls-publishers"], directory)
|
|
85
85
|
if(!out.toString().lines().any {_ == "firefly-team"}) {
|
|
86
86
|
system.writeErrorLine("")
|
|
87
87
|
system.writeErrorLine("You are not logged into vsce")
|
|
@@ -92,14 +92,14 @@ requireVsceLoggedIn(system: NodeSystem, workingDirectory: Path) {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
run(system: NodeSystem, command: String, arguments: List[String],
|
|
95
|
+
run(system: NodeSystem, command: String, arguments: List[String], directory: Path): ProcessResult {
|
|
96
96
|
system.writeLine("")
|
|
97
97
|
system.writeLine(command + " " + arguments.join(" "))
|
|
98
|
-
system.execute(command, arguments,
|
|
98
|
+
system.execute(command, arguments, directory = Some(directory))
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
runSuccessful(system: NodeSystem, command: String, arguments: List[String],
|
|
102
|
-
let out = run(system, command, arguments,
|
|
101
|
+
runSuccessful(system: NodeSystem, command: String, arguments: List[String], directory: Path): Buffer {
|
|
102
|
+
let out = run(system, command, arguments, directory)
|
|
103
103
|
if(out.exitCode != 0) {
|
|
104
104
|
system.writeBuffer(out.standardOut)
|
|
105
105
|
system.writeErrorBuffer(out.standardError)
|
package/core/NodeSystem.ff
CHANGED
|
@@ -102,7 +102,7 @@ extend self: NodeSystem {
|
|
|
102
102
|
command: String
|
|
103
103
|
arguments: List[String]
|
|
104
104
|
standardIn: Buffer = Buffer.new(0)
|
|
105
|
-
|
|
105
|
+
directory: Option[Path] = None
|
|
106
106
|
environment: Option[Map[String, String]] = None
|
|
107
107
|
maxBuffer: Int = 16777216
|
|
108
108
|
killSignal: Int = 9
|
|
@@ -119,12 +119,13 @@ 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_, directory_, environment_, $task)
|
|
125
|
+
).value_ || command_;
|
|
125
126
|
}
|
|
126
127
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
127
|
-
cwd:
|
|
128
|
+
cwd: directory_.value_,
|
|
128
129
|
windowsHide: true,
|
|
129
130
|
signal: $task.controller.signal,
|
|
130
131
|
killSignal: killSignal_,
|
|
@@ -203,15 +204,16 @@ internalFindCommand(out: String): String {
|
|
|
203
204
|
|
|
204
205
|
internalWindowsWhere(
|
|
205
206
|
system: NodeSystem
|
|
207
|
+
cmd: String
|
|
206
208
|
command: String
|
|
207
|
-
|
|
209
|
+
directory: 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
|
+
directory = directory
|
|
215
217
|
environment = environment
|
|
216
218
|
windowsWhere = False
|
|
217
219
|
)
|
|
@@ -136,13 +136,13 @@ return ""
|
|
|
136
136
|
}))
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
export function internalWindowsWhere_(system_, command_,
|
|
139
|
+
export function internalWindowsWhere_(system_, cmd_, command_, directory_ = 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), directory_, 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_,
|
|
184
|
+
export async function internalWindowsWhere_$(system_, cmd_, command_, directory_ = 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), directory_, 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, ".")
|
|
@@ -292,7 +292,7 @@ export function NodeSystem_environment(self_) {
|
|
|
292
292
|
throw new Error('Function NodeSystem_environment is missing on this target in sync context.');
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
export function NodeSystem_execute(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0),
|
|
295
|
+
export function NodeSystem_execute(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), directory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsWhere_ = true) {
|
|
296
296
|
throw new Error('Function NodeSystem_execute is missing on this target in sync context.');
|
|
297
297
|
}
|
|
298
298
|
|
|
@@ -406,7 +406,7 @@ export async function NodeSystem_environment$(self_, $task) {
|
|
|
406
406
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
export async function NodeSystem_execute$(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0),
|
|
409
|
+
export async function NodeSystem_execute$(self_, command_, arguments_, standardIn_ = ff_core_Buffer.new_(0), directory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), maxBuffer_ = 16777216, killSignal_ = 9, windowsWhere_ = true, $task) {
|
|
410
410
|
|
|
411
411
|
const childProcess = import$3;
|
|
412
412
|
const environment = environment_.value_ !== void 0 ? {} : process.env;
|
|
@@ -418,12 +418,13 @@ 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_, directory_, environment_, $task)
|
|
424
|
+
).value_ || command_;
|
|
424
425
|
}
|
|
425
426
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
426
|
-
cwd:
|
|
427
|
+
cwd: directory_.value_,
|
|
427
428
|
windowsHide: true,
|
|
428
429
|
signal: $task.controller.signal,
|
|
429
430
|
killSignal: killSignal_,
|
package/package.json
CHANGED