* usr/bin/byobu-launcher-install, usr/bin/byobu-launcher-uninstall:

- LP: #1002137
  - support fish shell in the installer
This commit is contained in:
Dustin Kirkland 2013-02-06 21:58:52 -06:00
commit 116568fad6
3 changed files with 15 additions and 2 deletions

3
debian/changelog vendored
View file

@ -17,6 +17,9 @@ byobu (5.31) unreleased; urgency=low
- use env for shebang in development tree
- fix this up in the postinst
+ seems racy -- there's got to better way of handling this???
* usr/bin/byobu-launcher-install, usr/bin/byobu-launcher-uninstall:
- LP: #1002137
- support fish shell in the installer
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 28 Jan 2013 02:21:15 -0600

View file

@ -47,6 +47,11 @@ install_launcher() {
printf "_byobu_sourced=1 . ${BYOBU_PREFIX}/bin/byobu-launch\n" >> "$1"
}
install_launcher_fish() {
$PKG-launcher-uninstall "$1" || true
printf "[ -z \"\$DISPLAY\" -a -z \"\$BYOBU_WINDOWS\" ] ; and [ \"\$TERM\" != \"dumb\" ] ; and exec byobu-launcher" >> "$1"
}
# Sanitize the environment
$PKG-launcher-uninstall || true
@ -70,6 +75,11 @@ case "$SHELL" in
;;
esac
# Handle fish shell
if [ -d "$HOME/.config/fish" ]; then
install_launcher_fish "$HOME/.config/fish/config.fish"
fi
# Hush login, since we will handle motd printing
touch "$HOME"/.hushlogin
rm -f "$BYOBU_CONFIG_DIR/disable-autolaunch"

View file

@ -27,14 +27,14 @@ remove_launcher() {
dest=$1
if [ -w "$dest" ]; then
# keep any comments, and remove lines invoking byobu:
$BYOBU_SED -i -e '/^\s*#/n' -e "/\b$PKG-launch\$/d" -e "/ screen-launch/d" "$dest"
$BYOBU_SED -i -e '/^\s*#/n' -e "/\b$PKG-launch\$/d" -e "/ screen-launch/d" "$dest" -e "/byobu-launcher$/d"
fi
}
if [ -f "$1" ]; then
remove_launcher "$1"
else
for i in ".profile" ".bashrc" ".bash_profile" ".bash_login" ".zprofile"; do
for i in ".profile" ".bashrc" ".bash_profile" ".bash_login" ".zprofile" ".config/fish/config.fish"; do
remove_launcher "$HOME/$i"
done
fi