don't check for trailing slash, var stream

This commit is contained in:
Dylan Conway
2023-08-10 19:06:51 -07:00
parent 513a6d0df3
commit a6ec7fe9b1
3 changed files with 9 additions and 9 deletions

View File

@@ -1079,8 +1079,7 @@ pub const RunCommand = struct {
return true;
} else if ((script_name_to_search.len > 1 and script_name_to_search[0] == '/') or
(script_name_to_search.len > 2 and script_name_to_search[0] == '.' and script_name_to_search[1] == '/' and
script_name_to_search[script_name_to_search.len - 1] != '/'))
(script_name_to_search.len > 2 and script_name_to_search[0] == '.' and script_name_to_search[1] == '/'))
{
Run.boot(ctx, ctx.allocator.dupe(u8, script_name_to_search) catch unreachable) catch |err| {
if (Output.enable_ansi_colors) {

View File

@@ -128,9 +128,9 @@ export function getStdioWriteStream(fd_, getWindowSize) {
_write(chunk, encoding, callback) {
if (!this.#writeStream) {
var { createWriteStream } = require("node:fs");
this.#writeStream = createWriteStream(this.#fdPath);
var stream = (this.#writeStream = createWriteStream(this.#fdPath));
this.#writeStream.on("finish", () => {
stream.on("finish", () => {
if (this.#onFinish) {
const cb = this.#onFinish;
this.#onFinish = null;
@@ -138,7 +138,7 @@ export function getStdioWriteStream(fd_, getWindowSize) {
}
});
this.#writeStream.on("drain", () => {
stream.on("drain", () => {
if (this.#onDrain) {
const cb = this.#onDrain;
this.#onDrain = null;
@@ -146,14 +146,15 @@ export function getStdioWriteStream(fd_, getWindowSize) {
}
});
eos(this.#writeStream, err => {
eos(stream, err => {
this.#writable = false;
if (err) {
destroy(this.#writeStream, err);
destroy(stream, err);
}
this.#onFinished(err);
});
}
if (this.#writeStream.write(chunk, encoding)) {
callback();
} else {

File diff suppressed because one or more lines are too long