diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-08-23 13:44:58 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-08-23 13:44:58 -0500 |
commit | 9309c2e3842fe1dd0b26566674ff0dc8ab7420a1 (patch) | |
tree | 440c5d4199e983edb019c6ca774c75b878c353a2 /tmux/.local/bin | |
parent | 0f1cc96cc3e8006184ba4b965ce2bb7060a97dc7 (diff) |
fix(zsh): fix type in output redirection
Diffstat (limited to 'tmux/.local/bin')
-rwxr-xr-x | tmux/.local/bin/tmux-sessionizer | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tmux/.local/bin/tmux-sessionizer b/tmux/.local/bin/tmux-sessionizer index 8750a4f..927fb41 100755 --- a/tmux/.local/bin/tmux-sessionizer +++ b/tmux/.local/bin/tmux-sessionizer @@ -1,11 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh +# shellcheck disable=2016 if [ "$#" -eq 1 ]; then selected="$1" else selected=$( find ~/src ~/.dotfiles -maxdepth 2 -type d,f -path '*/.git' -printf '%h\n' -prune | - xargs -I{} sh -c 'stat -c %Y:"{}" $XDG_DATA_HOME/nvim/sessions/$(echo "{}" | sed "s|/|%|g").vim || + xargs -I{} sh -c 'stat -c %Y:"{}" $XDG_DATA_HOME/nvim/sessions/$(echo "{}" | sed "s|/|%|g").vim || (git -C "{}" rev-parse HEAD &>/dev/null && git -C "{}" --no-pager log -1 --all --format="%at:{}" 2>/dev/null || stat -c %Y:"{}" "{}"/.git)' | sort -r | cut -d':' -f2- | @@ -20,7 +21,7 @@ fi selected_name=$(basename "$selected" | tr . _) tmux_running=$(pgrep tmux) -if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then +if [ -z "$TMUX" ] && [ -z "$tmux_running" ]; then tmux new-session -s "$selected_name" -c "$selected" exit 0 fi |