Skip to content

Commit 0c9fe67

Browse files
committed
feat: more error logging
1 parent b5e4178 commit 0c9fe67

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/components/run/dependencies.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path';
22
import fs from 'fs';
33
import React from 'react';
44
import {fileURLToPath} from 'url';
5-
import {useEffect} from 'react';
5+
import {useEffect, useState} from 'react';
66
import {Task} from 'ink-task-list';
77
import {useTask} from '../../hooks/usetask.js';
88
import {useRunStep} from '../../context/runstepcontext.js';
@@ -17,6 +17,8 @@ const __dirname = path.dirname(__filename);
1717
export default function Dependencies() {
1818
const [state, task, , , setTask, setLoading, setError] = useTask();
1919
const {step, setStep, envVars, directory, template, setHash} = useRunStep();
20+
const [output, setOutput] = useState<string>('');
21+
2022
useEffect(() => {
2123
if (step === 'dependencies' && !task) {
2224
setLoading(true);
@@ -53,7 +55,8 @@ export default function Dependencies() {
5355
setLoading(false);
5456
} catch (error) {
5557
console.error('Error installing dependencies:', error);
56-
setError('Error installing dependencies');
58+
setError(`Error installing dependencies: ${error.message}`);
59+
setOutput(`Error installing dependencies: ${error.message}`);
5760
setLoading(false);
5861
}
5962
}
@@ -65,6 +68,7 @@ export default function Dependencies() {
6568
label="Installing dependencies"
6669
state={state}
6770
spinner={spinners.dots}
71+
output={output}
6872
/>
6973
);
7074
}

0 commit comments

Comments
 (0)