Skip to content
Snippets Groups Projects
Commit bdc102bb authored by ferrari's avatar ferrari
Browse files

create setup.py

parent 7ce86099
Branches
No related tags found
No related merge requests found
from distutils.core import setup
setup(name='auto_git_info',
version='1.0',
description='Automatically log your command line arguments and commit sha',
author='Maxence Ferrari',
packages=['src'],
)
...@@ -17,8 +17,8 @@ def log_info(args, path=None): ...@@ -17,8 +17,8 @@ def log_info(args, path=None):
if '/' in path: if '/' in path:
os.makedirs(path.rsplit('/', 1)[0], exist_ok=True) os.makedirs(path.rsplit('/', 1)[0], exist_ok=True)
else: else:
if not os.path.isdir('run_log'): if not os.path.isdir('../run_log'):
os.makedirs('run_log') os.makedirs('../run_log')
path = 'run_log/' + time + '.json' path = 'run_log/' + time + '.json'
with open(path, 'w') as logfile: with open(path, 'w') as logfile:
repo = git.Repo(os.path.dirname(os.path.abspath(__main__.__file__)), search_parent_directories=True) repo = git.Repo(os.path.dirname(os.path.abspath(__main__.__file__)), search_parent_directories=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment