diff options
-rw-r--r-- | script/workspace/workspace.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index e69c6d76..485fd5f4 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -80,11 +80,6 @@ function m.getNativeMatcher() end local pattern = {} - -- config.get 'workspace.ignoreDir' - for path in pairs(config.get 'Lua.workspace.ignoreDir') do - log.info('Ignore directory:', path) - pattern[#pattern+1] = path - end -- config.get 'files.exclude' for path, ignore in pairs(config.get 'files.exclude') do if ignore then @@ -92,16 +87,6 @@ function m.getNativeMatcher() pattern[#pattern+1] = path end end - -- config.get 'workspace.ignoreSubmodules' - if config.get 'Lua.workspace.ignoreSubmodules' then - local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitmodules')) - if buf then - for path in buf:gmatch('path = ([^\r\n]+)') do - log.info('Ignore by .gitmodules:', path) - pattern[#pattern+1] = path - end - end - end -- config.get 'workspace.useGitIgnore' if config.get 'Lua.workspace.useGitIgnore' then local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitignore')) @@ -123,12 +108,27 @@ function m.getNativeMatcher() end end end + -- config.get 'workspace.ignoreSubmodules' + if config.get 'Lua.workspace.ignoreSubmodules' then + local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitmodules')) + if buf then + for path in buf:gmatch('path = ([^\r\n]+)') do + log.info('Ignore by .gitmodules:', path) + pattern[#pattern+1] = path + end + end + end -- config.get 'workspace.library' for path in pairs(config.get 'Lua.workspace.library') do path = m.getAbsolutePath(path) log.info('Ignore by library:', path) pattern[#pattern+1] = path end + -- config.get 'workspace.ignoreDir' + for path in pairs(config.get 'Lua.workspace.ignoreDir') do + log.info('Ignore directory:', path) + pattern[#pattern+1] = path + end m.nativeMatcher = glob.gitignore(pattern, m.matchOption, globInteferFace) m.nativeMatcher:setOption('root', m.path) |