Skip to content

Commit

Permalink
Add environment and auto-completion for "iceowl" host (macOS support)
Browse files Browse the repository at this point in the history
This commit adds a new environment configuration (1) for the new
`iceowl` host. The auto-completion scripts bundled with the Homebrew
git (2) and bash (3) forumlas should also be imported.

References:

  (1) https://github.com/arcticicestudio/igloo/tree/83bbc2530dbb21f7e734aaa9e33898d7c4c67d50/snowblocks/bash/config/env
  (2) https://formulae.brew.sh/formula/git
  (3) https://formulae.brew.sh/formula/bash

Epic: GH-131
Closes GH-146
  • Loading branch information
arcticicestudio committed Sep 19, 2018
1 parent 83bbc25 commit ac9f7bf
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
7 changes: 7 additions & 0 deletions snowblocks/bash/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,16 @@ __snowblock_bash::load_core_modules aliases functions prompt shelloptions
# + Third-Party Scripts +
# +---------------------+
# Git prompt bash support.
# Linux
__snowblock_bash::load_third_party_scripts /usr/share/git/completion/git-prompt.sh
# macOS
__snowblock_bash::load_third_party_scripts /usr/local/opt/git/etc/bash_completion.d/git-prompt.sh

# Programmable bash completion features.
# Linux
__snowblock_bash::load_third_party_scripts /usr/share/bash-completion/bash_completion
# macOS
__snowblock_bash::load_third_party_scripts /usr/local/opt/bash-completion@2/share/bash-completion/bash_completion

__snowblock_bash::setup_history
__snowblock_bash::register_binaries
Expand Down
63 changes: 63 additions & 0 deletions snowblocks/bash/config/env/iceowl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash

# Copyright (C) 2016-present Arctic Ice Studio <development@arcticicestudio.com>
# Copyright (C) 2016-present Sven Greb <development@svengreb.de>

# Project: igloo
# Repository: https://github.com/arcticicestudio/igloo
# License: MIT

# This environment comnfiguration contains some hardcoded paths (/usr/local/opt) because "$(brew --prefix <package>)"
# increases the start up time to more than 10 seconds!
# It seems like for each execution of the Ruby code a new instance is spawned that also spawns more shell processes.
# This might be caused by some macOS changes of essential logics from "El Capitan" to "High Sierra". Using the Homebrew
# command in subshell calls works fine on "El Capitan" and older versions.

export LANG=en_US.UTF-8
export LC_MESSAGES=POSIX

export EDITOR="$(command -v vim)"
export MANPAGER="$(command -v less)"
export VISUAL="$(command -v vim)"

BREW_PATH_COREUTILS="/usr/local/opt/coreutils/libexec/gnubin"
BREW_PATH_E2FSPROGS="/usr/local/opt/e2fsprogs/bin:/usr/local/opt/e2fsprogs/sbin"
BREW_PATH_ICU4C="/usr/local/opt/icu4c/bin:/usr/local/opt/icu4c/sbin"
BREW_PATH_OPENVPN="/usr/local/opt/openvpn/sbin"
BREW_PATH_PYTHON="/usr/local/opt/python/libexec/bin"
BREW_PATH_SQLITE="/usr/local/opt/sqlite/bin"

BREW_MANPATH_BASE="/usr/local/share/man"
BREW_MANPATH_COREUTILS="/usr/local/opt/coreutils/libexec/gnuman"

BREW_INFOPATH_BASE="/usr/local/share/info"

PATH_BIN="~/.bin"
PATH_GIT_CONTRIB_DIFF_HIGHLIGHT="/usr/local/opt/git/share/git-core/contrib/diff-highlight"

PATHS=(
"$BREW_PATH_COREUTILS"
"$BREW_PATH_E2FSPROGS"
"$BREW_PATH_ICU4C"
"$BREW_PATH_OPENVPN"
"$BREW_PATH_PYTHON"
"$BREW_PATH_SQLITE"
"$PATH_BIN"
"$PATH_GIT_CONTRIB_DIFF_HIGHLIGHT"
"$PATH"
)

MANPATHS=(
"$BREW_MANPATH_BASE"
"$BREW_MANPATH_COREUTILS"
"$MANPATH"
)

INFOPATHS=(
"$BREW_INFOPATH_BASE"
"$INFOPATH"
)

export PATH=$(IFS=$":"; echo "${PATHS[*]}")
export MANPATH=$(IFS=$":"; echo "${MANPATHS[*]}")
export INFOPATH=$(IFS=$":"; echo "${INFOPATHS[*]}")

0 comments on commit ac9f7bf

Please sign in to comment.