Skip to content

Commit

Permalink
pimp-my-shell.sh only on interactive
Browse files Browse the repository at this point in the history
This also fixes an issue between the trap and fzf-git.
Also simplified sourcing fzf and fzf-git as they are bound the be there
  • Loading branch information
hanoii committed Apr 5, 2024
1 parent 3cf43fb commit fbdac23
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .ddev/addon-metadata/pimp-my-shell/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pimp-my-shell
repository: .
version: ""
install_date: "2024-04-04T14:01:25-03:00"
install_date: "2024-04-05T09:20:34-03:00"
project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell.sh
Expand Down
12 changes: 8 additions & 4 deletions .ddev/homeadditions/.bashrc.d/pimp-my-shell.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ddev-generated

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# This is so that child processes have appropriate access to this var
export SHELL

Expand All @@ -10,12 +16,10 @@ export EDITOR=${DDEV_PIMP_MY_SHELL_EDITOR-/usr/bin/vim}
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

# fzf
[ -f /opt/.fzf.bash ] && source /opt/.fzf.bash
source /opt/.fzf.bash

# fzf-git
if ! grep -qxF "source /opt/fzf-git.sh/fzf-git.sh" ~/.bashrc ; then
echo -e "\n# Added by ddev-fzf add-on on $(date -u "+%Y-%m-%d %H:%m") \nsource /opt/fzf-git.sh/fzf-git.sh" >> ~/.bashrc
fi
source /opt/fzf-git.sh/fzf-git.sh

# z.lua
mkdir -p /mnt/ddev-global-cache/z.lua/${HOSTNAME}
Expand Down
12 changes: 8 additions & 4 deletions homeadditions/.bashrc.d/pimp-my-shell.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ddev-generated

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# This is so that child processes have appropriate access to this var
export SHELL

Expand All @@ -10,12 +16,10 @@ export EDITOR=${DDEV_PIMP_MY_SHELL_EDITOR-/usr/bin/vim}
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

# fzf
[ -f /opt/.fzf.bash ] && source /opt/.fzf.bash
source /opt/.fzf.bash

# fzf-git
if ! grep -qxF "source /opt/fzf-git.sh/fzf-git.sh" ~/.bashrc ; then
echo -e "\n# Added by ddev-fzf add-on on $(date -u "+%Y-%m-%d %H:%m") \nsource /opt/fzf-git.sh/fzf-git.sh" >> ~/.bashrc
fi
source /opt/fzf-git.sh/fzf-git.sh

# z.lua
mkdir -p /mnt/ddev-global-cache/z.lua/${HOSTNAME}
Expand Down

0 comments on commit fbdac23

Please sign in to comment.