Skip to content

Commit

Permalink
Allow running sinol-make in subdirectory of package
Browse files Browse the repository at this point in the history
(cherry picked from commit 8151dba)
  • Loading branch information
MasloMaslane committed Sep 23, 2023
1 parent c268ea1 commit 2fa690a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/sinol_make/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ def check_if_package():
"""
Function to check if current directory is a package
"""

cwd = os.getcwd()
if os.path.exists(os.path.join(cwd, 'config.yml')):
if os.path.exists(os.path.join(os.getcwd(), 'config.yml')):
return True
elif os.path.exists(os.path.join(os.getcwd(), '..', 'config.yml')):
os.chdir('..')
return True
return False
else:
return False


def exit_if_not_package():
Expand Down

0 comments on commit 2fa690a

Please sign in to comment.