Skip to content

Commit 5177932

Browse files
committed
Move skip versioning check to higher function
1 parent 3828e34 commit 5177932

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ func UploadFile(file *os.File, filename string, bucket string) (err error) {
143143
return nil
144144
}
145145

146-
func ShouldVersionFile(filename string, skipVersioning bool) (bool) {
146+
func ShouldVersionFile(filename string) bool {
147147
ext := filepath.Ext(filename)
148-
return !skipVersioning && (ext == ".js" || ext == ".css")
148+
return ext == ".js" || ext == ".css"
149149
}
150150

151151
func GetUploadFilename(file io.Reader, filename string, skipVersioning bool) (string, error) {
152152
uploadFilename := filename
153-
if ShouldVersionFile(filename, skipVersioning) {
153+
if !skipVersioning && ShouldVersionFile(filename) {
154154
checksum, errMd5 := GetFileMd5(file)
155155
if errMd5 != nil {
156156
return "", errMd5

0 commit comments

Comments
 (0)