feat: Make stop working without session name

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

@ -68,13 +68,6 @@ func main() {
userConfigDir := filepath.Join(ExpandPath("~/"), ".config/smug")
var configPath string
if options.Config != "" {
configPath = options.Config
} else {
configPath = filepath.Join(userConfigDir, options.Project+".yml")
}
var logger *log.Logger
if options.Debug {
logFile, err := os.Create(filepath.Join(userConfigDir, "smug.log"))
@ -90,6 +83,20 @@ func main() {
smug := Smug{tmux, commander}
context := CreateContext()
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")
}
switch options.Command {
case CommandStart:
if len(options.Windows) == 0 {

Loading…
Cancel
Save