Skip to content

Commit

Permalink
Merge PR #179 from webwarrior-ws/executable-check-fix
Browse files Browse the repository at this point in the history
scripts: include *.sh files in executable check.
  • Loading branch information
knocte authored Nov 6, 2024
2 parents 897fa58 + a73dfbe commit d567244
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/executableConvention.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ open System.IO
#load "../src/FileConventions/Helpers.fs"

let rootDir = Path.Combine(__SOURCE_DIRECTORY__, "..") |> DirectoryInfo
let currentDir = Directory.GetCurrentDirectory() |> DirectoryInfo

let targetDir = Helpers.PreferLessDeeplyNestedDir currentDir rootDir

let invalidFiles =
Helpers.GetInvalidFiles
rootDir
"*.fsx"
(fun fileInfo -> not(FileConventions.IsExecutable fileInfo))
let filter fileInfo =
not(FileConventions.IsExecutable fileInfo)

[ "*.fsx"; "*.sh" ]
|> Seq.collect(fun pattern ->
Helpers.GetInvalidFiles targetDir pattern filter
)

Helpers.AssertNoInvalidFiles
invalidFiles
Expand Down

0 comments on commit d567244

Please sign in to comment.