fix: Use ENV variable instead of session name

master
Ivan 2 years ago committed by GitHub
parent ec05ffef1e
commit 856940b719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,7 +38,7 @@ type Config struct {
func addDefaultEnvs(c *Config, path string) { func addDefaultEnvs(c *Config, path string) {
c.Env["SMUG_SESSION"] = c.Session 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 { func EditConfig(path string) error {

@ -87,15 +87,8 @@ func main() {
var configPath string var configPath string
if options.Config != "" { if options.Config != "" {
configPath = options.Config configPath = options.Config
} else if options.Project != "" {
configPath = filepath.Join(userConfigDir, options.Project+".yml")
} else { } else {
s, err := tmux.SessionName() configPath = filepath.Join(userConfigDir, options.Project+".yml")
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
configPath = filepath.Join(userConfigDir, s+".yml")
} }
switch options.Command { switch options.Command {

Loading…
Cancel
Save