Skip to content

Commit b01acae

Browse files
committed
Refactored isRequired function
1 parent 1626dc3 commit b01acae

File tree

1 file changed

+16
-52
lines changed

1 file changed

+16
-52
lines changed

main.go

Lines changed: 16 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -170,58 +170,22 @@ func zipSource(source string, target string, testsPath string) error {
170170
}
171171

172172
func isRequired(path string, testsPath string) bool {
173-
if IsNodeModules(path) || IsBowerComponents(path) {
174-
return false
175-
}
176-
177-
if IsInTestFolder(path, testsPath) {
178-
return false
179-
}
180-
181-
if IsTestFile(path) {
182-
return false
183-
}
184-
185-
if IsStyleSheet(path) {
186-
return false
187-
}
188-
189-
if IsImage(path) {
190-
return false
191-
}
192-
193-
if IsDocument(path) {
194-
return false
195-
}
196-
197-
if IsFont(path) {
198-
return false
199-
}
200-
201-
if IsGitFolder(path) {
202-
return false
203-
}
204-
205-
if IsDb(path) {
206-
return false
207-
}
208-
209-
if IsBuildFolder(path) || IsDistFolder(path) || IsPublicFolder(path) {
210-
return false
211-
}
212-
213-
if IsIdeFolder(path) {
214-
return false
215-
}
216-
217-
if IsVideo(path) {
218-
return false
219-
}
220-
221-
if IsMiscNotRequiredFile(path) {
222-
return false
223-
}
173+
return !IsNodeModules(path) &&
174+
!IsBowerComponents(path) &&
175+
!IsGitFolder(path) &&
176+
!IsInTestFolder(path, testsPath) &&
177+
!IsTestFile(path) &&
178+
!IsStyleSheet(path) &&
179+
!IsImage(path) &&
180+
!IsVideo(path) &&
181+
!IsDocument(path) &&
182+
!IsFont(path) &&
183+
!IsDb(path) &&
184+
!IsBuildFolder(path) &&
185+
!IsDistFolder(path) &&
186+
!IsPublicFolder(path) &&
187+
!IsIdeFolder(path) &&
188+
!IsMiscNotRequiredFile(path)
224189

225190
// the default is to not omit the file
226-
return true
227191
}

0 commit comments

Comments
 (0)