Skip to content

Commit d99fa72

Browse files
Merge pull request NaomiProject#281 from AustinCasteel/install-error-checking
Installer Error Checking
2 parents 1cc8c98 + 5ebfbf5 commit d99fa72

File tree

2 files changed

+60
-43
lines changed

2 files changed

+60
-43
lines changed

installers/naomi-setup.sh

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ unknown_os ()
5757
echo
5858
printf "${B_R}Notice:${B_W} You can find a list of supported OSes and distributions on our website: ${B_Y}https://projectnaomi.com/dev/docs/installation/${NL}"
5959
echo
60-
printf "${B_R}Notice:${B_W} Please email ${B_Y}[email protected]${B_W} and let us know if you run into any issues.${NL}"
60+
printf "${B_R}Notice:${B_W} Please join our Discord or email us at ${B_Y}[email protected]${B_W} and let us know if you run into any issues.${NL}"
6161
exit 1
6262
}
6363

@@ -218,7 +218,7 @@ function apt_setup_wizard() {
218218
echo
219219
exit 1
220220
fi
221-
else
221+
elif [ -f ~/Naomi/README.md ] && [ -f ~/Naomi/installers/script.deb.sh ]; then
222222
chmod a+x ~/Naomi/installers/script.deb.sh
223223
bash ~/Naomi/installers/script.deb.sh
224224
script_exit_code=$?
@@ -247,6 +247,14 @@ function apt_setup_wizard() {
247247
echo
248248
exit 1
249249
fi
250+
else
251+
printf "${B_W}=========================================================================${NL}"
252+
printf "${B_W}It looks like you have Naomi source in the ${B_G}~/Naomi${B_W} directory,${NL}"
253+
printf "${B_W}however it looks to be out of date. Please update or remove the Naomi${NL}"
254+
printf "${B_W}source and try running the installer again.${NL}"
255+
echo
256+
printf "${B_W}Please join our Discord or email us at ${B_Y}[email protected]${B_W} and let us know if you run into any issues.${NL}"
257+
exit 1
250258
fi
251259
}
252260
function yum_setup_wizard() {
@@ -283,7 +291,7 @@ function yum_setup_wizard() {
283291
echo
284292
exit 1
285293
fi
286-
else
294+
elif [ -f ~/Naomi/README.md ] && [ -f ~/Naomi/installers/script.rpm.sh ]; then
287295
chmod a+x ~/Naomi/installers/script.rpm.sh
288296
bash ~/Naomi/installers/script.rpm.sh
289297
script_exit_code=$?
@@ -312,6 +320,14 @@ function yum_setup_wizard() {
312320
echo
313321
exit 1
314322
fi
323+
else
324+
printf "${B_W}=========================================================================${NL}"
325+
printf "${B_W}It looks like you have Naomi source in the ${B_G}~/Naomi${B_W} directory,${NL}"
326+
printf "${B_W}however it looks to be out of date. Please update or remove the Naomi${NL}"
327+
printf "${B_W}source and try running the installer again.${NL}"
328+
echo
329+
printf "${B_W}Please join our Discord or email us at ${B_Y}[email protected]${B_W} and let us know if you run into any issues.${NL}"
330+
exit 1
315331
fi
316332
}
317333

@@ -334,44 +350,44 @@ os_detect
334350
curl_check
335351

336352
if [ ! -f ~/.config/naomi/configs/profile.yml ]; then
337-
echo
338-
echo
339-
echo
340-
echo
341-
printf "${B_W}=========================================================================${NL}"
342-
printf "${B_W}Welcome to Naomi. This process is designed to make getting started with${NL}"
343-
printf "${B_W}Naomi quick and easy. This process can take up to 3 hours to complete.${NL}"
344-
printf "${B_W}Would you like to continue with the process now or wait for another time?${NL}"
345-
echo
346-
printf "${B_M} Y${B_W})es, I'd like the proceed with the setup.${NL}"
347-
printf "${B_M} N${B_W})ope, I will come back at another time.${NL}"
348-
echo
349-
printf "${B_Blue}Choice [${B_M}Y${B_Blue}/${B_M}N${B_Blue}]: ${B_W}"
350-
while true; do
351-
read -N1 -s key
352-
case $key in
353-
[Nn])
354-
printf "${B_M}$key ${B_W}- Nope${NL}"
355-
echo
356-
printf "${B_W}Alright, Good luck & have fun!${NL}"
357-
echo
358-
break
359-
break
360-
;;
361-
[Yy])
362-
printf "${B_M}$key ${B_W}- Yes${NL}"
363-
echo
364-
if [ -n "$(command -v apt-get)" ]; then
365-
apt_setup_wizard
366-
elif [ -n "$(command -v yum)" ]; then
367-
unknown_os
368-
else
369-
unknown_os
370-
fi
371-
break
372-
;;
373-
esac
374-
done
353+
echo
354+
echo
355+
echo
356+
echo
357+
printf "${B_W}=========================================================================${NL}"
358+
printf "${B_W}Welcome to Naomi. This process is designed to make getting started with${NL}"
359+
printf "${B_W}Naomi quick and easy. This process can take up to 3 hours to complete.${NL}"
360+
printf "${B_W}Would you like to continue with the process now or wait for another time?${NL}"
361+
echo
362+
printf "${B_M} Y${B_W})es, I'd like the proceed with the setup.${NL}"
363+
printf "${B_M} N${B_W})ope, I will come back at another time.${NL}"
364+
echo
365+
printf "${B_Blue}Choice [${B_M}Y${B_Blue}/${B_M}N${B_Blue}]: ${B_W}"
366+
while true; do
367+
read -N1 -s key
368+
case $key in
369+
[Nn])
370+
printf "${B_M}$key ${B_W}- Nope${NL}"
371+
echo
372+
printf "${B_W}Alright, Good luck & have fun!${NL}"
373+
echo
374+
break
375+
break
376+
;;
377+
[Yy])
378+
printf "${B_M}$key ${B_W}- Yes${NL}"
379+
echo
380+
if [ -n "$(command -v apt-get)" ]; then
381+
apt_setup_wizard
382+
elif [ -n "$(command -v yum)" ]; then
383+
unknown_os
384+
else
385+
unknown_os
386+
fi
387+
break
388+
;;
389+
esac
390+
done
375391
else
376392
printf "${B_W}=========================================================================${NL}"
377393
printf "${B_W}It looks like you already have Naomi installed.${NL}"

installers/script.deb.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ setup_wizard() {
244244
;;
245245
S)
246246
printf "${B_M}$key ${B_W}- Skipping Section${NL}"
247+
echo '{"use_release":"testing", "version":"Naomi-Development", "auto_update":"false"}' > ~/.config/naomi/configs/.naomi_options.json
247248
break
248249
;;
249250
esac
@@ -613,7 +614,7 @@ setup_wizard() {
613614
exit 1
614615
fi
615616
fi
616-
cd pocketsphinx-python/sphinxbase
617+
cd pocketsphinx-python/deps/sphinxbase
617618
./autogen.sh
618619
make
619620
if [ $REQUIRE_AUTH -eq 1 ]; then
@@ -626,7 +627,7 @@ setup_wizard() {
626627
# Installing & Building pocketsphinx
627628
echo
628629
printf "${B_G}Building and installing pocketsphinx...${B_W}${NL}"
629-
cd ~/.config/naomi/sources/pocketsphinx-python/pocketsphinx
630+
cd ~/.config/naomi/sources/pocketsphinx-python/deps/pocketsphinx
630631
./autogen.sh
631632
make
632633
if [ $REQUIRE_AUTH -eq 1 ]; then

0 commit comments

Comments
 (0)