Skip to content

Commit

Permalink
fix: fix make config empty path (#148)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Gehrsitz <[email protected]>
  • Loading branch information
mryel00 authored Jul 22, 2023
1 parent 411be61 commit 064050a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions tools/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ set -Ee
CN_CONFIG_USER=$(whoami)
CN_CONFIG_CONFIGFILE="tools/.config"
CN_CONFIG_ROOTPATH="/home/${CN_CONFIG_USER}/printer_data"
# CN_CONFIG_CONFIGPATH="${CN_CONFIG_ROOTPATH}/config"
# CN_CONFIG_LOGPATH="${CN_CONFIG_ROOTPATH}/logs"
# CN_CONFIG_ENVPATH="${CN_CONFIG_ROOTPATH}/systemd"
# CN_MOONRAKER_CONFIG_PATH="${CN_CONFIG_CONFIGPATH}/moonraker.conf"
CN_CONFIG_CONFIGPATH="${CN_CONFIG_ROOTPATH}/config"
CN_CONFIG_LOGPATH="${CN_CONFIG_ROOTPATH}/logs"
CN_CONFIG_ENVPATH="${CN_CONFIG_ROOTPATH}/systemd"
CN_MOONRAKER_CONFIG_PATH="${CN_CONFIG_CONFIGPATH}/moonraker.conf"
CN_USTREAMER_REPO="https://github.com/pikvm/ustreamer.git"
CN_USTREAMER_BRANCH="master"
CN_CAMERA_STREAMER_REPO="https://github.com/ayufan-research/camera-streamer.git"
Expand Down Expand Up @@ -56,8 +56,8 @@ check_config_file_msg() {
}


default_path_msg() {
echo -e "Hit ENTER to use default."
confirm_path_msg() {
echo -e "Hit ENTER to confirm input."
}

root_path_msg() {
Expand Down Expand Up @@ -165,10 +165,9 @@ specify_root_path() {
local reply
root_path_msg
default_path_msg
read -erp "Please enter path: " reply
read -erp "Please enter path: " -i "${CN_CONFIG_ROOTPATH}" reply
if [[ -z "${reply}" ]]; then
echo -e "CROWSNEST_CONFIG_PATH=\"${CN_CONFIG_CONFIGPATH}\"" >> \
"${CN_CONFIG_CONFIGFILE}"
CN_CONFIG_ROOTPATH="${CN_CONFIG_ROOTPATH}"
return 0
fi
if [[ -n "${reply}" ]]; then
Expand All @@ -184,7 +183,7 @@ specify_root_path() {
specify_config_path() {
local reply
config_path_msg
default_path_msg
confirm_path_msg
read -erp "Please enter path: " -i "${CN_CONFIG_CONFIGPATH}" reply
if [[ -z "${reply}" ]]; then
echo -e "CROWSNEST_CONFIG_PATH=\"${CN_CONFIG_CONFIGPATH}\"" >> \
Expand All @@ -201,7 +200,7 @@ specify_config_path() {
specify_log_path() {
local reply
log_path_msg
default_path_msg
confirm_path_msg
read -erp "Please enter path: " -i "${CN_CONFIG_LOGPATH}" reply
if [[ -z "${reply}" ]]; then
echo -e "CROWSNEST_LOG_PATH=\"${CN_CONFIG_LOGPATH}\"" >> \
Expand All @@ -217,7 +216,7 @@ specify_log_path() {
specify_env_path() {
local reply
env_path_msg
default_path_msg
confirm_path_msg
read -erp "Please enter path: " -i "${CN_CONFIG_ENVPATH}" reply
if [[ -z "${reply}" ]]; then
echo -e "CROWSNEST_ENV_PATH=\"${CN_CONFIG_ENVPATH}\"" >> \
Expand Down

0 comments on commit 064050a

Please sign in to comment.