mirror of
https://github.com/Ascyii/scripts.git
synced 2026-01-01 04:44:24 -05:00
auto up 11:52:14 up 0:59, 2 users, load average: 0.27, 0.30, 0.33
This commit is contained in:
@@ -4,7 +4,10 @@ set -euo pipefail
|
||||
PROJECT_DIR=$(find ~/projects -mindepth 1 -maxdepth 1 -type d | fzf --prompt='Select project: ')
|
||||
[ -z "$PROJECT_DIR" ] && exit 0
|
||||
|
||||
# Sanitize session name
|
||||
SESSION_NAME=$(basename "$PROJECT_DIR")
|
||||
SESSION_NAME=${SESSION_NAME//./_}
|
||||
SESSION_NAME=${SESSION_NAME// /_}
|
||||
|
||||
# If session exists, switch or attach depending on context
|
||||
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user