Skip to content

Commit

Permalink
feat: use filepath matching to support wildcard matching for startup …
Browse files Browse the repository at this point in the history
…scripts (#81)
  • Loading branch information
joshmedeski authored Mar 4, 2024
1 parent e003271 commit 5e998c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tmux/tmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"os"
"os/exec"
"path/filepath"
"strings"

"github.com/joshmedeski/sesh/config"
Expand Down Expand Up @@ -132,7 +133,8 @@ func execStartupScript(name string, scriptPath string) error {

func getStartupScript(sessionPath string, config *config.Config) string {
for _, script := range config.StartupScripts {
if dir.FullPath(script.SessionPath) == sessionPath {
match, _ := filepath.Match(dir.FullPath(script.SessionPath), sessionPath)
if match {
return dir.FullPath(script.ScriptPath)
}
}
Expand Down

0 comments on commit 5e998c7

Please sign in to comment.