Skip to content

Commit ab97f94

Browse files
committed
fix: unify symlink handling for site and stream on posix and win
1 parent 909d63b commit ab97f94

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/self_check/resolve_path_win.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import "path/filepath"
99
// inclde sites-enabled/*.conf
1010

1111
func resolvePath(path ...string) string {
12-
return filepath.Join(path...) + ".conf"
12+
return filepath.ToSlash(filepath.Join(path...) + ".conf")
1313
}

internal/site/disable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
// Disable disables a site by removing the symlink in sites-enabled
1919
func Disable(name string) (err error) {
20-
enabledConfigFilePath := nginx.GetConfPath("sites-enabled", name)
20+
enabledConfigFilePath := nginx.GetConfSymlinkPath(nginx.GetConfPath("sites-enabled", name))
2121
_, err = os.Stat(enabledConfigFilePath)
2222
if err != nil {
2323
return

internal/stream/disable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
// Disable disables a site by removing the symlink in sites-enabled
1919
func Disable(name string) (err error) {
20-
enabledConfigFilePath := nginx.GetConfPath("streams-enabled", name)
20+
enabledConfigFilePath := nginx.GetConfSymlinkPath(nginx.GetConfPath("streams-enabled", name))
2121
_, err = os.Stat(enabledConfigFilePath)
2222
if err != nil {
2323
return

0 commit comments

Comments
 (0)