diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-24 18:39:45 -0400 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-24 18:39:45 -0400 |
| commit | 7249bcf997902b995430b4352a9f03f8e812e52d (patch) | |
| tree | c35f21032e6a6999911645fe0d07091b6ab61120 /modules | |
| parent | aa39da597b2a3a079d1ca0a3bd6d2b8bfe6bb659 (diff) | |
| download | home-7249bcf997902b995430b4352a9f03f8e812e52d.tar.gz | |
final script update
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/tmux/session-load.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/tmux/session-load.sh b/modules/tmux/session-load.sh index 623ff57..b342d93 100644 --- a/modules/tmux/session-load.sh +++ b/modules/tmux/session-load.sh @@ -4,7 +4,11 @@ # the name of the symlink is the name of the project # if there is no path specified, prompt via fzf -# +if ! [[ -d $HOME/.projects ]]; then + echo "Error: Couldn't find '~/.projects' directory." >&2 + exit 1 +fi + if [[ $# -eq 1 ]]; then input=$1 else @@ -18,8 +22,8 @@ fi project_name=$input project_path=$(readlink "$HOME/.projects/$project_name") -if [[ -d $project_path ]] - echo "Error: directory '$project_path' does not exist." >&2 +if ! [[ -d $project_path ]]; then + echo "Error: Directory '$project_path' does not exist." >&2 exit 1 fi @@ -31,7 +35,7 @@ if ! tmux has-session -t $project_name 2> /dev/null; then tmux new -ds $project_name -c $project_dir fi -if ! [[ -f ${project_path}/Session.vim ]] then +if ! [[ -f ${project_path}/Session.vim ]]; then $(cd $project_path; nvim --headless +Obsession +q >/dev/null 2>&1) fi |