Skip to content

Commit

Permalink
fix: Use ENV variable instead of session name
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaaaan committed Jun 24, 2022
1 parent ec05ffe commit 856940b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Config struct {

func addDefaultEnvs(c *Config, path string) {
c.Env["SMUG_SESSION"] = c.Session
c.Env["SMUG_SESSION_NAME"] = c.Session
c.Env["SMUG_SESSION_CONFIG_PATH"] = path
}

func EditConfig(path string) error {
Expand Down
9 changes: 1 addition & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,8 @@ func main() {
var configPath string
if options.Config != "" {
configPath = options.Config
} else if options.Project != "" {
configPath = filepath.Join(userConfigDir, options.Project+".yml")
} else {
s, err := tmux.SessionName()
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
configPath = filepath.Join(userConfigDir, s+".yml")
configPath = filepath.Join(userConfigDir, options.Project+".yml")
}

switch options.Command {
Expand Down

0 comments on commit 856940b

Please sign in to comment.