File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/KoalaWiki/Infrastructure Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,22 @@ public static async Task<string> ReadMeFile(string path)
149
149
/// <returns></returns>
150
150
public static string [ ] GetIgnoreFiles ( string path )
151
151
{
152
+ var ignoreFiles = new List < string > ( ) ;
153
+
152
154
var ignoreFilePath = Path . Combine ( path , ".gitignore" ) ;
153
155
if ( File . Exists ( ignoreFilePath ) )
154
156
{
155
157
// 需要去掉注释
156
158
var lines = File . ReadAllLines ( ignoreFilePath ) ;
157
- var ignoreFiles = lines . Where ( x => ! string . IsNullOrWhiteSpace ( x ) && ! x . StartsWith ( "#" ) )
158
- . Select ( x => x . Trim ( ) ) . ToList ( ) ;
159
-
160
- ignoreFiles . AddRange ( DocumentOptions . ExcludedFiles ) ;
161
-
162
- return ignoreFiles . ToArray ( ) ;
159
+ ignoreFiles . AddRange ( lines . Where ( x => ! string . IsNullOrWhiteSpace ( x ) && ! x . StartsWith ( "#" ) )
160
+ . Select ( x => x . Trim ( ) ) ) ;
163
161
}
164
162
165
- return [ ] ;
163
+ // 始终添加配置的排除文件和文件夹
164
+ ignoreFiles . AddRange ( DocumentOptions . ExcludedFiles ) ;
165
+ ignoreFiles . AddRange ( DocumentOptions . ExcludedFolders ) ;
166
+
167
+ return ignoreFiles . ToArray ( ) ;
166
168
}
167
169
168
170
public static List < PathInfo > GetCatalogueFiles ( string path )
You can’t perform that action at this time.
0 commit comments