Skip to content

Commit

Permalink
Deploying to gh-pages from @ 40f8e82 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nin-jin committed Oct 10, 2024
1 parent 2538cf1 commit 5a6c33c
Show file tree
Hide file tree
Showing 15 changed files with 1,154 additions and 584 deletions.
563 changes: 282 additions & 281 deletions node.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node.d.ts.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node.deps.json

Large diffs are not rendered by default.

31 changes: 25 additions & 6 deletions node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node.js.map

Large diffs are not rendered by default.

31 changes: 25 additions & 6 deletions node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2121,20 +2121,31 @@ var $;
$.$mol_run_error = $mol_run_error;
const child_process = $node['child_process'];
$.$mol_run_spawn = child_process.spawn.bind(child_process);
$.$mol_run_spawn_sync = child_process.spawnSync.bind(child_process);
function $mol_run_async({ dir, timeout, command, env }) {
const args_raw = typeof command === 'string' ? command.split(' ') : command;
const [app, ...args] = args_raw;
this.$mol_log3_come({
place: '$mol_run_async',
dir: $node.path.relative('', dir),
message: 'Run',
command: args_raw.join(' '),
});
if (!env?.MOL_RUN_ASYNC) {
this.$mol_log3_come({
place: '$mol_run_sync',
message: 'Run',
command: args_raw.join(' '),
dir: $node.path.relative('', dir),
});
return this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
}
const sub = this.$mol_run_spawn(app, args, {
shell: true,
cwd: dir,
env
});
this.$mol_log3_come({
place: '$mol_run_async',
pid: sub.pid,
message: 'Run',
command: args_raw.join(' '),
dir: $node.path.relative('', dir),
});
let killed = false;
let timer;
const std_data = [];
Expand Down Expand Up @@ -2170,6 +2181,14 @@ var $;
get stdout() { return Buffer.concat(std_data); },
get stderr() { return Buffer.concat(error_data); }
};
this.$mol_log3_done({
place: '$mol_run_async',
pid: sub.pid,
message: 'Run',
status,
command: args_raw.join(' '),
dir: $node.path.relative('', dir),
});
if (error || status || killed)
return fail(new $mol_run_error((res.stderr.toString() || res.stdout.toString() || 'Run error') + (killed ? ', timeout' : ''), { signal, timeout: killed }, ...error ? [error] : []));
done(res);
Expand Down
33 changes: 26 additions & 7 deletions node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2112,20 +2112,31 @@ var $;
$.$mol_run_error = $mol_run_error;
const child_process = $node['child_process'];
$.$mol_run_spawn = child_process.spawn.bind(child_process);
$.$mol_run_spawn_sync = child_process.spawnSync.bind(child_process);
function $mol_run_async({ dir, timeout, command, env }) {
const args_raw = typeof command === 'string' ? command.split(' ') : command;
const [app, ...args] = args_raw;
this.$mol_log3_come({
place: '$mol_run_async',
dir: $node.path.relative('', dir),
message: 'Run',
command: args_raw.join(' '),
});
if (!env?.MOL_RUN_ASYNC) {
this.$mol_log3_come({
place: '$mol_run_sync',
message: 'Run',
command: args_raw.join(' '),
dir: $node.path.relative('', dir),
});
return this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
}
const sub = this.$mol_run_spawn(app, args, {
shell: true,
cwd: dir,
env
});
this.$mol_log3_come({
place: '$mol_run_async',
pid: sub.pid,
message: 'Run',
command: args_raw.join(' '),
dir: $node.path.relative('', dir),
});
let killed = false;
let timer;
const std_data = [];
Expand Down Expand Up @@ -2161,6 +2172,14 @@ var $;
get stdout() { return Buffer.concat(std_data); },
get stderr() { return Buffer.concat(error_data); }
};
this.$mol_log3_done({
place: '$mol_run_async',
pid: sub.pid,
message: 'Run',
status,
command: args_raw.join(' '),
dir: $node.path.relative('', dir),
});
if (error || status || killed)
return fail(new $mol_run_error((res.stderr.toString() || res.stdout.toString() || 'Run error') + (killed ? ', timeout' : ''), { signal, timeout: killed }, ...error ? [error] : []));
done(res);
Expand Down Expand Up @@ -13418,7 +13437,7 @@ var $;
});
let message = '';
try {
const res = await $mol_wire_async(context_mock).$mol_run({ command: 'sleep 10', dir: '.', timeout: 10 });
const res = await $mol_wire_async(context_mock).$mol_run({ command: 'sleep 10', dir: '.', timeout: 10, env: { 'MOL_RUN_ASYNC': '1' } });
}
catch (e) {
message = e.message;
Expand Down
2 changes: 1 addition & 1 deletion node.test.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 5a6c33c

Please sign in to comment.