File tree Expand file tree Collapse file tree 1 file changed +8
-41
lines changed
Expand file tree Collapse file tree 1 file changed +8
-41
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ install_uv() {
7070setup_repository () {
7171 if [ -d " $INSTALL_DIR " ]; then
7272 print_info " Repository already exists at $INSTALL_DIR "
73+
74+ # Redirect stdin to /dev/tty for read
75+ if [ ! -t 0 ]; then
76+ exec < /dev/tty
77+ fi
78+
7379 read -p " $( echo -e ${YELLOW} Update scripts? [Y/n]:${NC} ) " -n 1 -r
7480 echo
7581
@@ -120,21 +126,7 @@ install_dependencies() {
120126 fi
121127}
122128
123- run_script () {
124- print_step " Running script..."
125-
126- cd " $INSTALL_DIR "
127-
128- if uv run main.py; then
129- print_success " Script executed successfully"
130- return 0
131- else
132- print_error " Error executing script"
133- return 1
134- fi
135- }
136-
137- print_manual_run () {
129+ print_final_message () {
138130 echo
139131 echo -e " ${CYAN}${BOLD} ════════════════════════════════════════${NC} "
140132 echo -e " ${GREEN}${BOLD} Installation completed!${NC} "
@@ -152,11 +144,6 @@ print_manual_run() {
152144}
153145
154146main () {
155- # Redirect stdin to /dev/tty if running through pipe (curl | bash)
156- if [ ! -t 0 ]; then
157- exec < /dev/tty
158- fi
159-
160147 clear
161148 print_header
162149
@@ -176,27 +163,7 @@ main() {
176163 exit 1
177164 fi
178165
179- echo
180-
181- read -p " $( echo -e ${GREEN}${BOLD} Run script now? [Y/n]:${NC} ) " -n 1 -r
182- echo
183- echo
184-
185- if [[ $REPLY =~ ^[Nn]$ ]]; then
186- print_manual_run
187- else
188- if run_script; then
189- echo
190- print_success " Done!"
191- echo
192- print_info " To run again use:"
193- echo -e " ${MAGENTA} cd $INSTALL_DIR && uv run main.py${NC} "
194- echo
195- else
196- echo
197- print_manual_run
198- fi
199- fi
166+ print_final_message
200167
201168 if [[ ! " :$PATH :" == * " :$HOME /.cargo/bin:" * ]]; then
202169 echo
You can’t perform that action at this time.
0 commit comments