Skip to content

Commit fedb4d9

Browse files
committed
profiles: Check whether profile is running
Instead of erroring, confirm whether the profile is running, if it isn't it is safe to delete to file and start a new profile. Signed-off-by: Paulo Gomes <[email protected]>
1 parent af6ac4a commit fedb4d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/profiles/profiles.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ func StartFromGit(runner, name, gitURL, path, local string) error {
8686
ln := files.ProfileConfig(name)
8787

8888
if _, err := os.Lstat(ln); err == nil {
89-
// Wayland is not cleaning up profile state after closure.
90-
if !strings.EqualFold(os.Getenv("XDG_SESSION_TYPE"), "wayland") {
89+
if container.Running(runner, fmt.Sprintf(ContainerNameFormat, name)) {
9190
return fmt.Errorf("profile %q is already started", name)
9291
}
92+
9393
if err = os.Remove(ln); err != nil {
9494
return fmt.Errorf("failed to remove leftover profile symlink: %w", err)
9595
}

0 commit comments

Comments
 (0)