detect environment variables desynchronization from .bashrc
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "bashdb",
|
||||
"request": "launch",
|
||||
"name": "Bash-Debug (hardcoded script name)",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"program": "${workspaceFolder}/path/to/script.sh",
|
||||
"args": []
|
||||
},
|
||||
{
|
||||
"type": "bashdb",
|
||||
"request": "launch",
|
||||
"name": "Bash-Debug (simplest configuration)",
|
||||
"program": "${file}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user