Adds tn.sh script for tmux session creation
This commit is contained in:
11
scripts/shell/tn.sh
Executable file
11
scripts/shell/tn.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DIR_NAME=${PWD##*/}
|
||||||
|
|
||||||
|
tmux has-session -t $DIR_NAME 2>/dev/null
|
||||||
|
if [ $? -eq 1 ]; then
|
||||||
|
tmux new -s $DIR_NAME
|
||||||
|
else
|
||||||
|
echo "Session with current dirname was found. The script will exit now..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user