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
|
exit 1
|
||||||
fi
|
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
|
exit 1
|
||||||
fi
|
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")"
|
content="$(cat "$template")"
|
||||||
echo "${content//\{\{SESSION_NAME\}\}/$layout_name}" > "$layout_file"
|
echo "${content//\{\{SESSION_NAME\}\}/$layout_name}" > "$layout_file"
|
||||||
|
|
||||||
if [ ! -z "$EDITOR" ]; then
|
if [ -n "$EDITOR" ]; then
|
||||||
exec "$EDITOR" "$layout_file"
|
exec "$EDITOR" "$layout_file"
|
||||||
else
|
else
|
||||||
echo "Layout file has been created, but '\$EDITOR' is not set. Please "
|
echo "Layout file has been created, but '\$EDITOR' is not set. Please "
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ fi
|
|||||||
content="$(cat "$template")"
|
content="$(cat "$template")"
|
||||||
echo "${content//\{\{WINDOW_NAME\}\}/$layout_name}" > "$layout_file"
|
echo "${content//\{\{WINDOW_NAME\}\}/$layout_name}" > "$layout_file"
|
||||||
|
|
||||||
if [ ! -z "$EDITOR" ]; then
|
if [ -n "$EDITOR" ]; then
|
||||||
exec "$EDITOR" "$layout_file"
|
exec "$EDITOR" "$layout_file"
|
||||||
else
|
else
|
||||||
echo "Layout file has been created, but '\$EDITOR' is not set. Please "
|
echo "Layout file has been created, but '\$EDITOR' is not set. Please "
|
||||||
|
|||||||
Reference in New Issue
Block a user