Browse Source

Reset robots.txt in install action

Vova Tkach 6 years ago
parent
commit
90563e726e
2 changed files with 13 additions and 2 deletions
  1. 3 2
      hosts/localhost/template/robots.txt
  2. 10 0
      modules/module_index_act_mysql_setup.go

+ 3 - 2
hosts/localhost/template/robots.txt

@@ -1,2 +1,3 @@
-User-agent: *
-Disallow: /
+User-agent: *
+Disallow: /
+

+ 10 - 0
modules/module_index_act_mysql_setup.go

@@ -296,6 +296,16 @@ func (this *Modules) RegisterAction_IndexMysqlSetup() *Action {
 			return
 			return
 		}
 		}
 
 
+		// Reset robots.txt file
+		f, err := os.Create(wrap.DTemplate + string(os.PathSeparator) + "robots.txt")
+		if err == nil {
+			defer f.Close()
+			if _, err = f.WriteString("User-agent: *\nDisallow: /\n\n"); err != nil {
+				wrap.MsgError(err.Error())
+				return
+			}
+		}
+
 		// Reload current page
 		// Reload current page
 		wrap.Write(`window.location.reload(false);`)
 		wrap.Write(`window.location.reload(false);`)
 	})
 	})