firefly-compiler 0.4.64 → 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 +5 -5
- package/output/js/ff/core/NodeSystem.mjs +8 -8
- 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
|
|
@@ -121,11 +121,11 @@ extend self: NodeSystem {
|
|
|
121
121
|
if(windowsWhere_ && process.platform === 'win32') {
|
|
122
122
|
const cmd = process.env.ComSpec || "cmd.exe";
|
|
123
123
|
command_ = (
|
|
124
|
-
await internalWindowsWhere_$(self_, cmd, command_,
|
|
124
|
+
await internalWindowsWhere_$(self_, cmd, command_, directory_, environment_, $task)
|
|
125
125
|
).value_ || command_;
|
|
126
126
|
}
|
|
127
127
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
128
|
-
cwd:
|
|
128
|
+
cwd: directory_.value_,
|
|
129
129
|
windowsHide: true,
|
|
130
130
|
signal: $task.controller.signal,
|
|
131
131
|
killSignal: killSignal_,
|
|
@@ -206,14 +206,14 @@ internalWindowsWhere(
|
|
|
206
206
|
system: NodeSystem
|
|
207
207
|
cmd: String
|
|
208
208
|
command: String
|
|
209
|
-
|
|
209
|
+
directory: Option[Path] = None
|
|
210
210
|
environment: Option[Map[String, String]] = None
|
|
211
211
|
): Option[String] {
|
|
212
212
|
if(!command.all {c => c.isAsciiLetterOrDigit() || c == '_' || c == '-'}) {None} else:
|
|
213
213
|
let out = system.execute(
|
|
214
214
|
cmd,
|
|
215
215
|
["/c", "where", command],
|
|
216
|
-
|
|
216
|
+
directory = directory
|
|
217
217
|
environment = environment
|
|
218
218
|
windowsWhere = False
|
|
219
219
|
)
|
|
@@ -136,13 +136,13 @@ return ""
|
|
|
136
136
|
}))
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
export function internalWindowsWhere_(system_, cmd_, 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_, cmd_, ["/c", "where", command_], ff_core_Buffer.new_(0, false),
|
|
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_, cmd_, 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_, cmd_, ["/c", "where", command_], ff_core_Buffer.new_(0, false),
|
|
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;
|
|
@@ -420,11 +420,11 @@ export async function NodeSystem_execute$(self_, command_, arguments_, standardI
|
|
|
420
420
|
if(windowsWhere_ && process.platform === 'win32') {
|
|
421
421
|
const cmd = process.env.ComSpec || "cmd.exe";
|
|
422
422
|
command_ = (
|
|
423
|
-
await internalWindowsWhere_$(self_, cmd, command_,
|
|
423
|
+
await internalWindowsWhere_$(self_, cmd, command_, directory_, environment_, $task)
|
|
424
424
|
).value_ || command_;
|
|
425
425
|
}
|
|
426
426
|
const newProcess = childProcess.spawn(command_, arguments_, {
|
|
427
|
-
cwd:
|
|
427
|
+
cwd: directory_.value_,
|
|
428
428
|
windowsHide: true,
|
|
429
429
|
signal: $task.controller.signal,
|
|
430
430
|
killSignal: killSignal_,
|
package/package.json
CHANGED