🐛 fix OnProjectStart

should only run when session is created.
This commit is contained in:
James Walker 2021-12-02 16:52:06 -05:00
parent 1ff2a54582
commit 3abfabb1b4
Signed by: walkah
GPG Key ID: 3C127179D6086E93

View File

@ -29,6 +29,9 @@ func StartProject(name string) {
os.Exit(1) os.Exit(1)
} }
tmux := CreateTmux(false)
if !sessionExists(name) {
// Run startup commands // Run startup commands
if len(p.OnProjectStart) > 0 { if len(p.OnProjectStart) > 0 {
for _, command := range p.OnProjectStart { for _, command := range p.OnProjectStart {
@ -45,9 +48,6 @@ func StartProject(name string) {
} }
} }
tmux := CreateTmux(false)
if !sessionExists(name) {
tmux.Run("new-session", "-d", "-s", name, "-n", p.Windows[0].Name, "-c", p.Windows[0].Root) tmux.Run("new-session", "-d", "-s", name, "-n", p.Windows[0].Name, "-c", p.Windows[0].Root)
for index, window := range p.Windows { for index, window := range p.Windows {