Skip to content

Commit

Permalink
Extract fresh add argument parsing into its own function
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncodes committed May 4, 2013
1 parent 2a505b7 commit 96c979f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/fresh
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ $(fresh_commands | sed -e 's/^/ /' -e 's/ #//')
EOF
}

fresh_add() {
_parse_fresh_add_args() {
if [[ "$1" == https://github.com/* ]]; then
URL="$1"

Expand All @@ -736,9 +736,14 @@ fresh_add() {
if [[ "$REF" != "master" ]]; then
LINE="$LINE --ref=$REF"
fi
echo "$LINE"
else
LINE="$(_escape "$@")"
_escape "$@"
fi
}

fresh_add() {
LINE="$(_parse_fresh_add_args "$@")"

if _confirm "Add \`fresh $LINE\` to $(_freshrc_file)"; then
echo "Adding \`fresh $LINE\` to $(_freshrc_file)..."
Expand Down

0 comments on commit 96c979f

Please sign in to comment.