소스 검색

fix: unify symlink handling for site and stream on posix and win

Jacky 2 달 전
부모
커밋
ab97f94356
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      internal/self_check/resolve_path_win.go
  2. 1 1
      internal/site/disable.go
  3. 1 1
      internal/stream/disable.go

+ 1 - 1
internal/self_check/resolve_path_win.go

@@ -9,5 +9,5 @@ import "path/filepath"
 // inclde sites-enabled/*.conf
 
 func resolvePath(path ...string) string {
-	return filepath.Join(path...) + ".conf"
+	return filepath.ToSlash(filepath.Join(path...) + ".conf")
 }

+ 1 - 1
internal/site/disable.go

@@ -17,7 +17,7 @@ import (
 
 // Disable disables a site by removing the symlink in sites-enabled
 func Disable(name string) (err error) {
-	enabledConfigFilePath := nginx.GetConfPath("sites-enabled", name)
+	enabledConfigFilePath := nginx.GetConfSymlinkPath(nginx.GetConfPath("sites-enabled", name))
 	_, err = os.Stat(enabledConfigFilePath)
 	if err != nil {
 		return

+ 1 - 1
internal/stream/disable.go

@@ -17,7 +17,7 @@ import (
 
 // Disable disables a site by removing the symlink in sites-enabled
 func Disable(name string) (err error) {
-	enabledConfigFilePath := nginx.GetConfPath("streams-enabled", name)
+	enabledConfigFilePath := nginx.GetConfSymlinkPath(nginx.GetConfPath("streams-enabled", name))
 	_, err = os.Stat(enabledConfigFilePath)
 	if err != nil {
 		return