moving
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
isDirectExecution,
|
||||
makePreCompactHandler,
|
||||
runHook,
|
||||
type HookRunOptions,
|
||||
@@ -20,15 +21,6 @@ export async function runPreCompact(opts: Partial<HookRunOptions> = {}): Promise
|
||||
});
|
||||
}
|
||||
|
||||
const isMain = (() => {
|
||||
try {
|
||||
if (typeof process.argv[1] !== 'string') return false;
|
||||
const url = new URL(`file://${process.argv[1].replace(/\\/g, '/')}`);
|
||||
return url.href === import.meta.url;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (isMain) {
|
||||
if (isDirectExecution(import.meta.url)) {
|
||||
void runPreCompact();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
isDirectExecution,
|
||||
makeSessionStartHandler,
|
||||
runHook,
|
||||
type HookRunOptions,
|
||||
@@ -23,15 +24,6 @@ export async function runSessionStart(opts: Partial<HookRunOptions> = {}): Promi
|
||||
});
|
||||
}
|
||||
|
||||
const isMain = (() => {
|
||||
try {
|
||||
if (typeof process.argv[1] !== 'string') return false;
|
||||
const url = new URL(`file://${process.argv[1].replace(/\\/g, '/')}`);
|
||||
return url.href === import.meta.url;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (isMain) {
|
||||
if (isDirectExecution(import.meta.url)) {
|
||||
void runSessionStart();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
isDirectExecution,
|
||||
makeStopHandler,
|
||||
runHook,
|
||||
type HookRunOptions,
|
||||
@@ -21,15 +22,6 @@ export async function runStop(opts: Partial<HookRunOptions> = {}): Promise<void>
|
||||
});
|
||||
}
|
||||
|
||||
const isMain = (() => {
|
||||
try {
|
||||
if (typeof process.argv[1] !== 'string') return false;
|
||||
const url = new URL(`file://${process.argv[1].replace(/\\/g, '/')}`);
|
||||
return url.href === import.meta.url;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (isMain) {
|
||||
if (isDirectExecution(import.meta.url)) {
|
||||
void runStop();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
isDirectExecution,
|
||||
makeUserPromptSubmitHandler,
|
||||
runHook,
|
||||
type HookRunOptions,
|
||||
@@ -19,15 +20,6 @@ export async function runUserPromptSubmit(opts: Partial<HookRunOptions> = {}): P
|
||||
});
|
||||
}
|
||||
|
||||
const isMain = (() => {
|
||||
try {
|
||||
if (typeof process.argv[1] !== 'string') return false;
|
||||
const url = new URL(`file://${process.argv[1].replace(/\\/g, '/')}`);
|
||||
return url.href === import.meta.url;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (isMain) {
|
||||
if (isDirectExecution(import.meta.url)) {
|
||||
void runUserPromptSubmit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user