Skip to content

Commit

Permalink
style: load_session: move return case up, removing indent
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Apr 2, 2016
1 parent a9a8799 commit 3a8a43c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/layout-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,26 +202,26 @@ load_session() {
file="$1"
fi

if [ -f "$file" ]; then
if [ $# -gt 1 ]; then
session="$2"
else
session="${1/%.session.sh}"
session="${session/%.sh}"
fi

set_default_path=true
source "$file"
session=

# Reset `$session_root`.
if [[ "$session_root" != "$HOME" ]]; then
session_root="$HOME"
fi
else
if ! [ -f "$file" ]; then
echo "\"$1\" session layout not found." >&2
return 1
fi

if [ $# -gt 1 ]; then
session="$2"
else
session="${1/%.session.sh}"
session="${session/%.sh}"
fi

set_default_path=true
source "$file"
session=

# Reset `$session_root`.
if [[ "$session_root" != "$HOME" ]]; then
session_root="$HOME"
fi
}

# Create a new session, returning 0 on success, 1 on failure.
Expand Down

0 comments on commit 3a8a43c

Please sign in to comment.