Compare commits

..

No commits in common. "12476b507a51e51a1844586c279847ede07045ae" and "6431e7abbe11aabfc600321b2687bcc775f41490" have entirely different histories.

13
init.sh
View File

@ -169,11 +169,8 @@ if [ "$init_local_install" = true ]; then
param7="local"
fi
# Auto-detect installation mode based on provided parameters. Only when init.sh
# is EXECUTED directly (install time) — start.sh sources init.sh for its function
# definitions at runtime (Model A, as the manager), and this block must not run
# then (it would print a spurious "Auto-detected ..." and rewrite the config).
if [[ "${BASH_SOURCE[0]}" == "$0" && -z "$param7" ]]; then
# Auto-detect installation mode based on provided parameters
if [[ -z "$param7" ]]; then
# A reinstall that doesn't re-pass the git args must not silently
# downgrade an existing git install to local (that disables the updater
# and blanks the saved creds). Honor a git URL already saved from a
@ -211,9 +208,9 @@ initUpdateConfigOption() {
local comment_part=$(echo "$original_line" | sed -n "s|^$config_option=[^#]*\(#.*\)|\1|p")
if [[ -n "$comment_part" ]]; then
sed -i "s|^$config_option=.*|$config_option=$escaped_value $comment_part|" "$config_file"
sudo sed -i "s|^$config_option=.*|$config_option=$escaped_value $comment_part|" "$config_file"
else
sed -i "s|^$config_option=.*|$config_option=$escaped_value|" "$config_file"
sudo sed -i "s|^$config_option=.*|$config_option=$escaped_value|" "$config_file"
fi
source "$config_file"
return 0
@ -226,7 +223,7 @@ initUpdateConfigOption() {
return 1
}
if [[ "${BASH_SOURCE[0]}" == "$0" && -n "$param7" && -f "${configs_dir}general/general_install" ]]; then
if [[ -n "$param7" && -f "${configs_dir}general/general_install" ]]; then
initUpdateConfigOption "CFG_INSTALL_MODE" "$param7"
fi