-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for fish #126
Open
bugabinga
wants to merge
7
commits into
freshshell:master
Choose a base branch
from
bugabinga:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support for fish #126
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c0a0b02
Inroduced variable FRESH_REPO to install.sh so that forks of fresh ca…
36b4602
Push to repo to test vagrant support.
6c55582
sed error fix
7a84273
Fixed sed!
d3d96fb
Added missing ).
2703664
Reverted Vagrant testing changes, because they were not really useful.
e10fd94
Detecting the default shell via $SHELL now.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,13 +86,30 @@ fresh_after_build() { | |
} | ||
|
||
_fresh_preamble() { | ||
|
||
local no_path_export fresh_path user_shell="$(getent passwd $LOGNAME | cut -d: -f7)" | ||
if [[ $user_shell == *"fish"* ]]; then | ||
no_path_export="set __FRESH_BIN_PATH__ (echo $FRESH_BIN_PATH | sed -e s@$HOME@\$HOME@) | ||
if not contains \$__FRESH_BIN_PATH__ \$PATH | ||
set -U fish_user_paths \$fish_user_paths \$__FRESH_BIN_PATH__ | ||
end | ||
set -u __FRESH_BIN_PATH__ | ||
" | ||
fresh_path="set -U FRESH_PATH=\"$FRESH_PATH\"" | ||
else | ||
no_path_export="__FRESH_BIN_PATH__="${FRESH_BIN_PATH/#$HOME/\$HOME}"; [[ ! \$PATH =~ (^|:)\$__FRESH_BIN_PATH__(:|\$) ]] && export PATH=\"\$__FRESH_BIN_PATH__:\$PATH\"; unset __FRESH_BIN_PATH__" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be named |
||
fresh_path="export FRESH_PATH=\"$FRESH_PATH\"" | ||
fi | ||
|
||
|
||
if [ -z "${__FRESH_PREAMBLE_DONE__:-}" ]; then | ||
if [ -z "${FRESH_NO_PATH_EXPORT:-}" ]; then | ||
echo "__FRESH_BIN_PATH__="${FRESH_BIN_PATH/#$HOME/\$HOME}"; [[ ! \$PATH =~ (^|:)\$__FRESH_BIN_PATH__(:|\$) ]] && export PATH=\"\$__FRESH_BIN_PATH__:\$PATH\"; unset __FRESH_BIN_PATH__" >> "$FRESH_PATH/build.new/shell.sh" | ||
echo "$no_path_export" >> "$FRESH_PATH/build.new/shell.sh" | ||
fi | ||
echo "export FRESH_PATH=\"$FRESH_PATH\"" >> "$FRESH_PATH/build.new/shell.sh" | ||
echo "$fresh_path" >> "$FRESH_PATH/build.new/shell.sh" | ||
__FRESH_PREAMBLE_DONE__=1 | ||
fi | ||
|
||
} | ||
|
||
_dsl_install_fresh() { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getent
is not available on Mac OS X. Would it be possible to detectfish
via the presence of an environment variable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would using the $SHELL variable be more portable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$SHELL
should be fine.