]> git.nbdom.net Git - nb.git/commitdiff
etc/profile
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 Oct 2017 23:38:41 +0000 (00:38 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 Oct 2017 23:38:41 +0000 (00:38 +0100)
etc/profile
etc/profile.d/aliases
etc/profile.d/envs

index bf329ed591953aabf95a3aedaa0886c37b0a9e88..11314509c74fe950cf0719bfddf7bda1b1f675b6 100755 (executable)
@@ -5,9 +5,14 @@
 # To test:
 # docker run --rm -it -v $NB_ROOT:$NB_ROOT alpine sh -c " . $NB_ROOT/etc/profile --debug && nb_repos && echo OK"
 #
+# Load order:
+# 1. etc/profile.d/function
+# 2. etc/profile.d/envs
+# 3. etc/profile.d/alias
+# 4. etc/profile.d/*.sh
 #
 #--------------------------------------------------------------------------------
-[ "$1" = "--debug-nb" ] && export NB_DEBUG="echo DEBUG: " && shift
+[ "$1" = "--nb-debug" ] && export NB_DEBUG="echo DEBUG: " && shift
 
 #
 # Avoid infinit loop. Eg: profile -> .bashrc -> profile
index 27e7be6070b26d7504ce0166645d4700e067a41b..c32bb13c0c7567591122a6ed16195759f090093f 100644 (file)
@@ -31,3 +31,33 @@ bc --version > /dev/null && alias bc="bc -q"
 # vim
 #
 vim --version > /dev/null && alias vi=vim
+
+#--------------------------------------------------------------------------------
+# ls
+#
+ls_opt=' -aF'
+ll_opt=' -lh'
+
+#if [ "$SHELL_NAME" != "busybox" ]; then
+if ! ls --help 2>&1 | grep -qm1 ^BusyBox; then
+
+  if [ -n "$DARWIN" ]; then
+    [ "$color_prompt" = yes ] && ls_opt="$ls_opt -G"
+  else
+    [ "$color_prompt" = yes ] && ls_opt="$ls_opt --color=auto"
+    ll_opt="$ll_opt --time-style=long-iso"
+  fi
+
+fi
+
+[ -n "$ls_opt" ] && alias ls="ls${ls_opt}"
+[ -n "$ll_opt" ] && alias ll="ls${ll_opt}"
+unset ls_opt ll_opt
+
+#--------------------------------------------------------------------------------
+# grep
+#
+if ! grep --help 2>&1 | grep -qm1 ^BusyBox; then
+  alias grep='grep --color=auto'
+fi
+
index 3d61f419eb4a6f11a1af4187b77fc809caf43a82..e3de20d5f0cbc395d1279cdb31a481ec6db21fb6 100644 (file)
@@ -95,41 +95,3 @@ if is_prompt; then
     linux) color_prompt=yes;;
   esac
 fi
-
-#
-# Alias ls
-#
-ls_opt=' -aF'
-ll_opt=' -lh'
-
-#if [ "$SHELL_NAME" != "busybox" ]; then
-if ! ls --help 2>&1 | grep -qm1 ^BusyBox; then
-
-  if [ -n "$DARWIN" ]; then
-    [ "$color_prompt" = yes ] && ls_opt="$ls_opt -G"
-  else
-    [ "$color_prompt" = yes ] && ls_opt="$ls_opt --color=auto"
-    ll_opt="$ll_opt --time-style=long-iso"
-  fi
-
-fi
-
-[ -n "$ls_opt" ] && alias ls="ls${ls_opt}"
-[ -n "$ll_opt" ] && alias ll="ls${ll_opt}"
-unset ls_opt ll_opt
-
-#
-# Alias grep
-#
-if ! grep --help 2>&1 | grep -qm1 ^BusyBox; then
-  alias grep='grep --color=auto'
-fi
-
-#
-# bye
-#
-#[ -n "$NB_DEBUG" ] && $NB_DEBUG "Color: $color_prompt, TERM=$TERM"
-[ -n "$NB_DEBUG" ] && [ -n "$color_prompt" ] && $NB_DEBUG "Color: $color_prompt"
-[ -n "$NB_DEBUG" ] && [ -n "$TERM" ] && $NB_DEBUG "TERM=$TERM"
-
-# NB 24.10.17 unset color_prompt