mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Improve EDITOR checks
This commit is contained in:
@@ -37,4 +37,10 @@ if [ ! -f "$layout_file" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$EDITOR" "$layout_file"
|
||||
if [ -n "$EDITOR" ]; then
|
||||
exec "$EDITOR" "$layout_file"
|
||||
else
|
||||
echo "'\$EDITOR' is not set. Please manually open the layout for editing:"
|
||||
echo "$layout_file"
|
||||
echo
|
||||
fi
|
||||
|
||||
@@ -37,4 +37,10 @@ if [ ! -f "$layout_file" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$EDITOR" "$layout_file"
|
||||
if [ -n "$EDITOR" ]; then
|
||||
exec "$EDITOR" "$layout_file"
|
||||
else
|
||||
echo "'\$EDITOR' is not set. Please manually open the layout for editing:"
|
||||
echo "$layout_file"
|
||||
echo
|
||||
fi
|
||||
|
||||
@@ -46,7 +46,7 @@ fi
|
||||
content="$(cat "$template")"
|
||||
echo "${content//\{\{SESSION_NAME\}\}/$layout_name}" > "$layout_file"
|
||||
|
||||
if [ ! -z "$EDITOR" ]; then
|
||||
if [ -n "$EDITOR" ]; then
|
||||
exec "$EDITOR" "$layout_file"
|
||||
else
|
||||
echo "Layout file has been created, but '\$EDITOR' is not set. Please "
|
||||
|
||||
@@ -46,7 +46,7 @@ fi
|
||||
content="$(cat "$template")"
|
||||
echo "${content//\{\{WINDOW_NAME\}\}/$layout_name}" > "$layout_file"
|
||||
|
||||
if [ ! -z "$EDITOR" ]; then
|
||||
if [ -n "$EDITOR" ]; then
|
||||
exec "$EDITOR" "$layout_file"
|
||||
else
|
||||
echo "Layout file has been created, but '\$EDITOR' is not set. Please "
|
||||
|
||||
Reference in New Issue
Block a user