|
|
@ -11,18 +11,20 @@ function bashrc_count_lines { |
|
|
|
function bashrc_watch_start { |
|
|
|
if [[ -z "${BASHRC_LINES+set}" ]]; then |
|
|
|
BASHRC_LINES=$(bashrc_count_lines) |
|
|
|
else |
|
|
|
BASHRC_EVOLVED=true |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
function bashrc_watch_end { |
|
|
|
bashrc_lines=$(bashrc_count_lines) |
|
|
|
if [[ "$BASHRC_LINES" -lt "$bashrc_lines" ]]; then |
|
|
|
if [[ "$BASHRC_LINES" -lt "$bashrc_lines" || -n "${BASHRC_EVOLVED+set}" ]]; then |
|
|
|
echo |
|
|
|
echo '*****************************' |
|
|
|
echo '* BASHRC has evolved *' |
|
|
|
echo '* please execute: *' |
|
|
|
echo '* BASHRC has evolved! *' |
|
|
|
echo '* please synchronize: *' |
|
|
|
echo '* *' |
|
|
|
echo "* source \$HOME/.bashrc *" |
|
|
|
echo "* source ~/.bashrc *" |
|
|
|
echo '* *' |
|
|
|
echo '*****************************' |
|
|
|
echo |
|
|
@ -52,6 +54,7 @@ bashrc_watch_start |
|
|
|
|
|
|
|
echo 'init' |
|
|
|
bashrc_env_sync 'SESSION_RESTART' true |
|
|
|
bashrc_env_sync 'TOTO' fluo |
|
|
|
echo 'end' |
|
|
|
|
|
|
|
bashrc_watch_end |