Skip to content
Snippets Groups Projects
Commit 4b1a2f55 authored by mjbonifa's avatar mjbonifa
Browse files

Merge branch '4-write-git-ignore-for-phenotype-repos' into 'dev'

added gitignore to phen init. closes #4

Closes #4

See merge request meldb/concepts-processing!6
parents 9a7bda9d 60973bce
No related branches found
No related tags found
No related merge requests found
......@@ -39,14 +39,15 @@ class Proto:
tuple[
str, # The description, e.g., "Not Empty"
Callable[
[list], pd.Series,
[list],
pd.Series,
], # The first lambda function: takes a list and returns a pd.Series of booleans
Callable[
[list, str], None,
[list, str],
None,
], # The second lambda function: takes a list and a string, and returns nothing
]
]
def __init__(self, name, trud_codes_path=None):
if trud_codes_path is not None:
......
......@@ -136,7 +136,6 @@ def init(phen_dir, remote_url):
repo.clone(git_url, phen_path)
# open repo
repo = git.Repo(phen_path)
# check if there are any commits (new repo has no commits)
if (
len(repo.branches) == 0 or repo.head.is_detached
......@@ -202,16 +201,23 @@ def init(phen_dir, remote_url):
},
"codes": [],
}
config_path = phen_path / CONFIG_FILE
with open(config_path, "w", encoding="utf-8") as f:
json.dump(config, f, indent=4)
# TODO: add gitignore
# Ignore all SQLite database files
# *.db
# *.sqlite
# *.sqlite3
# add git ignore
ignore_content = """# Ignore SQLite database files
*.db
*.sqlite3
# Ignore SQLite journal and metadata files
*.db-journal
*.sqlite3-journal
"""
ignore_path = phen_path / ".gitignore"
with open(ignore_path, "w") as file:
file.write(ignore_content)
# add to git repo and commit
for d in DEFAULT_PHEN_DIR_LIST:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment