Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2e9f563

Browse files
committed
convert / to \ for abs path check using filepath
1 parentd2582ed commit2e9f563

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎cli/open.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func isWindowsAbsPath(p string) bool {
251251
switch {
252252
caselen(p)==0:
253253
returnfalse
254-
casep[0]=='/'||p[0]=='\\':
254+
casep[0]=='\\':
255255
returntrue
256256
default:
257257
returnfalse
@@ -305,11 +305,12 @@ func resolveAgentAbsPath(workingDirectory, relOrAbsPath, agentOS string, local b
305305
returnp,nil
306306

307307
caseagentOS=="windows":
308+
relOrAbsPath=strings.ReplaceAll(relOrAbsPath,"/","\\")
308309
switch {
309310
caseworkingDirectory!=""&&!isWindowsAbsPath(relOrAbsPath):
310311
returnwindowsJoinPath(workingDirectory,relOrAbsPath),nil
311312
caseisWindowsAbsPath(relOrAbsPath):
312-
returnwindowsJoinPath(relOrAbsPath),nil
313+
returnrelOrAbsPath,nil
313314
default:
314315
return"",xerrors.Errorf("path %q not supported, use an absolute path instead",relOrAbsPath)
315316
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp