Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 02c7b3a

Browse files
feat: get ignore dirs/files from .gitignore
1 parent cf8eb6d commit 02c7b3a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎Github-Automation/ignore.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
3+
cwd = os.getcwd()
4+
ignorepath = os.path.join(cwd, '.gitignore')
5+
6+
7+
def getIgnoreFiles():
8+
ignorefiles = []
9+
with open(ignorepath) as ignore:
10+
files = ignore.readlines()
11+
for file in files:
12+
file = ''.join(file.splitlines())
13+
if(file != ''):
14+
filepath = os.path.join(cwd , file)
15+
if(os.path.isfile(filepath) or os.path.isdir(filepath)):
16+
ignorefiles.append(file)
17+
return ignorefiles

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /