MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / deleteWebsiteFolder

Function deleteWebsiteFolder

agent/app/service/website_utils.go:1023–1041  ·  view source on GitHub ↗
(website *model.Website)

Source from the content-addressed store, hash-verified

1021}
1022
1023func deleteWebsiteFolder(website *model.Website) error {
1024 siteFolder := GetSitePath(*website, SiteDir)
1025 fileOp := files.NewFileOp()
1026 if fileOp.Stat(siteFolder) {
1027 _ = fileOp.DeleteDir(siteFolder)
1028 }
1029 if website.Type == constant.Stream {
1030 steamFilePath := GetSitePath(*website, StreamConf)
1031 if fileOp.Stat(steamFilePath) {
1032 _ = fileOp.DeleteFile(steamFilePath)
1033 }
1034 } else {
1035 nginxFilePath := GetSitePath(*website, SiteConf)
1036 if fileOp.Stat(nginxFilePath) {
1037 _ = fileOp.DeleteFile(nginxFilePath)
1038 }
1039 }
1040 return nil
1041}
1042
1043func opWebsite(website *model.Website, operate string) error {
1044 nginxInstall, err := getNginxFull(website)

Callers 1

CreateWebsiteMethod · 0.85

Calls 4

StatMethod · 0.95
DeleteDirMethod · 0.95
DeleteFileMethod · 0.95
GetSitePathFunction · 0.85

Tested by

no test coverage detected