重置Root
()
| 81 | |
| 82 | // 重置Root |
| 83 | func (this *ServiceManager) resetRoot() { |
| 84 | if !Tea.IsTesting() { |
| 85 | exePath, err := os.Executable() |
| 86 | if err != nil { |
| 87 | exePath = os.Args[0] |
| 88 | } |
| 89 | link, err := filepath.EvalSymlinks(exePath) |
| 90 | if err == nil { |
| 91 | exePath = link |
| 92 | } |
| 93 | fullPath, err := filepath.Abs(exePath) |
| 94 | if err == nil { |
| 95 | Tea.UpdateRoot(filepath.Dir(filepath.Dir(fullPath))) |
| 96 | } |
| 97 | } |
| 98 | Tea.SetPublicDir(Tea.Root + Tea.DS + "web" + Tea.DS + "public") |
| 99 | Tea.SetViewsDir(Tea.Root + Tea.DS + "web" + Tea.DS + "views") |
| 100 | Tea.SetTmpDir(Tea.Root + Tea.DS + "web" + Tea.DS + "tmp") |
| 101 | } |
| 102 | |
| 103 | // PauseWindow 保持命令行窗口是打开的 |
| 104 | func (this *ServiceManager) PauseWindow() { |