Browse Source

Made pathing with regards to the static assets bundling system platform agnostic

Wirecog 6 years ago
parent
commit
90404bbf33
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      static.go

+ 6
- 6
static.go View File

55
 		return
55
 		return
56
 	}
56
 	}
57
 
57
 
58
-	if _, err := os.Stat(StaticAssetsPath + "/js"); os.IsNotExist(err) {
59
-		os.Mkdir(StaticAssetsPath+"/js", 0711)
58
+	if _, err := os.Stat(filepath.Join(StaticAssetsPath, "js")); os.IsNotExist(err) {
59
+		os.Mkdir(filepath.Join(StaticAssetsPath, "js"), 0711)
60
 	}
60
 	}
61
 
61
 
62
-	destinationFile := StaticAssetsPath + "/js/" + outputFileName
62
+	destinationFile := filepath.Join(StaticAssetsPath, "js", outputFileName)
63
 
63
 
64
 	for i := 0; i < len(jsfiles); i++ {
64
 	for i := 0; i < len(jsfiles); i++ {
65
 		b, err := ioutil.ReadFile(jsfiles[i])
65
 		b, err := ioutil.ReadFile(jsfiles[i])
109
 		return
109
 		return
110
 	}
110
 	}
111
 
111
 
112
-	if _, err := os.Stat(StaticAssetsPath + "/css"); os.IsNotExist(err) {
113
-		os.Mkdir(StaticAssetsPath+"/css", 0711)
112
+	if _, err := os.Stat(filepath.Join(StaticAssetsPath, "css")); os.IsNotExist(err) {
113
+		os.Mkdir(filepath.Join(StaticAssetsPath, "css"), 0711)
114
 	}
114
 	}
115
 
115
 
116
-	destinationFile := StaticAssetsPath + "/css/" + outputFileName
116
+	destinationFile := filepath.Join(StaticAssetsPath, "css", outputFileName)
117
 
117
 
118
 	for i := 0; i < len(cssfiles); i++ {
118
 	for i := 0; i < len(cssfiles); i++ {
119
 		b, err := ioutil.ReadFile(cssfiles[i])
119
 		b, err := ioutil.ReadFile(cssfiles[i])