Skip to content

Commit 93d912e

Browse files
committed
Do not assume shell rc file exists during setup.
1 parent 00d88b9 commit 93d912e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/testhelpers/e2e/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ func (s *Session) SetupRCFileCustom(subshell subshell.SubShell) {
787787
rcFile, err := subshell.RcFile()
788788
require.NoError(s.T, err)
789789

790-
if fileutils.TargetExists(filepath.Join(s.Dirs.HomeDir, filepath.Base(rcFile))) {
790+
if fileutils.TargetExists(rcFile) && fileutils.TargetExists(filepath.Join(s.Dirs.HomeDir, filepath.Base(rcFile))) {
791791
err = fileutils.CopyFile(rcFile, filepath.Join(s.Dirs.HomeDir, filepath.Base(rcFile)))
792792
} else {
793793
err = fileutils.Touch(filepath.Join(s.Dirs.HomeDir, filepath.Base(rcFile)))

0 commit comments

Comments
 (0)