Skip to content

Commit fd56d39

Browse files
committed
use read-only file mode for windows
1 parent 8bb5713 commit fd56d39

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli/logout_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cli_test
33
import (
44
"os"
55
"regexp"
6+
"runtime"
67
"testing"
78

89
"github.com/stretchr/testify/assert"
@@ -135,7 +136,12 @@ func TestLogout(t *testing.T) {
135136
require.FileExists(t, string(config.Session()))
136137

137138
// Changing the permissions to throw error during deletion.
138-
err := os.Chmod(string(config), 0500)
139+
var err error
140+
if runtime.GOOS == "windows" {
141+
err = os.Chmod(string(config), 0400)
142+
} else {
143+
err = os.Chmod(string(config), 0500)
144+
}
139145
require.NoError(t, err)
140146

141147
logoutChan := make(chan struct{})

0 commit comments

Comments
 (0)