octo-dev 0.4.0 → 0.4.1
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/package.json
CHANGED
package/src/cli/index.ts
CHANGED
package/src/hooks/hook-runner.ts
CHANGED
|
@@ -29,7 +29,7 @@ export async function runHooks(trigger: HookTrigger, context: HookContext): Prom
|
|
|
29
29
|
logger.info(`Running hook "${hook.name}" (${trigger})...`);
|
|
30
30
|
const start = Date.now();
|
|
31
31
|
|
|
32
|
-
const result = await run(hook.command, [], { cwd: context.workingDir });
|
|
32
|
+
const result = await run(hook.command, [], { cwd: context.workingDir, shell: true });
|
|
33
33
|
const durationMs = Date.now() - start;
|
|
34
34
|
const output = (result.stdout + result.stderr).trim() || undefined;
|
|
35
35
|
|
package/src/shared/ollama.ts
CHANGED
|
@@ -24,9 +24,10 @@ async function hasModel(model: string): Promise<boolean> {
|
|
|
24
24
|
*/
|
|
25
25
|
async function install(): Promise<boolean> {
|
|
26
26
|
logger.info('Instalando Ollama...');
|
|
27
|
-
const result = await run('curl
|
|
27
|
+
const result = await run('curl -fsSL https://ollama.com/install.sh | sh', [], {
|
|
28
28
|
timeout: 120_000,
|
|
29
29
|
interactive: true,
|
|
30
|
+
shell: true,
|
|
30
31
|
});
|
|
31
32
|
return result.exitCode === 0;
|
|
32
33
|
}
|
|
@@ -6,6 +6,8 @@ export interface RunOptions {
|
|
|
6
6
|
env?: Record<string, string>;
|
|
7
7
|
/** When true, inherits stdio so the user can interact (e.g. git password prompts) */
|
|
8
8
|
interactive?: boolean;
|
|
9
|
+
/** When true, runs command through the system shell. Use only for piped commands. */
|
|
10
|
+
shell?: boolean;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface RunResult {
|
|
@@ -16,13 +18,13 @@ export interface RunResult {
|
|
|
16
18
|
|
|
17
19
|
/** Wrapper for child_process.spawn with Promise, timeout, and stdout/stderr capture */
|
|
18
20
|
export function run(command: string, args: string[] = [], options: RunOptions = {}): Promise<RunResult> {
|
|
19
|
-
const { cwd, timeout = 60_000, env, interactive = false } = options;
|
|
21
|
+
const { cwd, timeout = 60_000, env, interactive = false, shell = false } = options;
|
|
20
22
|
|
|
21
23
|
return new Promise((resolve, reject) => {
|
|
22
24
|
const child = spawn(command, args, {
|
|
23
25
|
cwd,
|
|
24
26
|
env: env ? { ...process.env, ...env } : process.env,
|
|
25
|
-
shell
|
|
27
|
+
shell,
|
|
26
28
|
stdio: interactive ? 'inherit' : 'pipe',
|
|
27
29
|
});
|
|
28
30
|
|