Skip to content

Commit 06ff403

Browse files
authored
Merge pull request #1476 from irhndt/main
incus/project: Fix handling of default (unset) project in `get-current`
2 parents 411dc2a + 0570f40 commit 06ff403

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/incus/project.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,11 @@ func (c *cmdProjectGetCurrent) Run(cmd *cobra.Command, args []string) error {
11851185
return fmt.Errorf(i18n.G("Remote %s doesn't exist"), conf.DefaultRemote)
11861186
}
11871187

1188-
fmt.Println(remote.Project)
1188+
if remote.Project == "" {
1189+
fmt.Println(api.ProjectDefaultName)
1190+
} else {
1191+
fmt.Println(remote.Project)
1192+
}
1193+
11891194
return nil
11901195
}

0 commit comments

Comments
 (0)