Skip to content

Commit 5629fc5

Browse files
authored
closes #1031 (#1032)
fixes an issue with file paths to ignore when the file has no extension the issue was due to trying to add a when it got a path that did not start with a and that did not have an extension already (this is incidentally why this wasn't flagged for )
1 parent b67570e commit 5629fc5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Franklin"
22
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
33
authors = ["Thibaut Lienart <[email protected]>"]
4-
version = "0.10.84"
4+
version = "0.10.85"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/eval/io.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ $(SIGNATURES)
1111
Internal function to take a relative path and return a unix version of the path
1212
(if it isn't already). Used in [`resolve_rpath`](@ref).
1313
"""
14-
function unixify(rpath::AS)::AS
14+
function unixify(rpath::AS; allow_noext::Bool=false)::AS
1515
# if empty, return "/"
1616
isempty(rpath) && return "/"
1717
# if windows, replace "\\" by "/"
1818
Sys.isunix() || (rpath = replace(rpath, "\\" => "/"))
1919
# if it's a path to a dot file, like path/.gitignore, return (issue #1001)
20-
startswith(splitdir(rpath)[2], ".") && return rpath
20+
startswith(splitdir(rpath)[2], ".") && return rpath
2121
# if it has an extension e.g.: /blah.txt, return
2222
isempty(splitext(rpath)[2]) || return rpath
23+
# if an extension-less path is allowed, return (issue #1031)
24+
allow_noext && return rpath
2325
# if it doesn't have an extension, check if it ends with `/` e.g. : /blah/
2426
# if it doesn't end with "/", add one and return
2527
endswith(rpath, "/") || return rpath * "/"

src/manager/dir_utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ Rules:
212212
function should_ignore(fpath::AS, files2ignore::Vector,
213213
dirs2ignore::Vector)::Bool
214214
# fpath is necessarily an absolute path so can strip the folder part
215-
fpath = fpath[length(path(:folder))+length(PATH_SEP)+1:end] |> unixify
215+
fpath = fpath[length(path(:folder))+length(PATH_SEP)+1:end]
216+
fpath = unixify(fpath; allow_noext=true)
216217
if any(c -> c isa Regex ? match(c, fpath) !== nothing : c == fpath,
217218
files2ignore)
218219
return true

0 commit comments

Comments
 (0)