Browse Source

get site path from arg

Example:

hugo-encrypt /path/to/html/files
Dennis Rodewyk 5 năm trước cách đây
mục cha
commit
32054e22ae
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      hugo-encrypt.go

+ 2 - 1
hugo-encrypt.go

@@ -63,7 +63,8 @@ func encryptPage(path string) {
 }
 
 func main() {
-	err := filepath.Walk("./public", func(path string, f os.FileInfo, err error) error {
+	sitePath := os.Args[1]
+	err := filepath.Walk(sitePath, func(path string, f os.FileInfo, err error) error {
 		if f == nil {
 			return err
 		}