ejwa / gitinspector

:bar_chart: The statistical analysis tool for git repositories
GNU General Public License v3.0
2.37k stars 328 forks source link

Uncaught exception on unexisting folder #238

Open foxyseta opened 1 year ago

foxyseta commented 1 year ago
$ gitinspector unexisting-folder
Traceback (most recent call last):
  File "/usr/local/bin/gitinspector", line 24, in <module>
    gitinspector.main()
  File "/usr/local/lib/node_modules/gitinspector/gitinspector/gitinspector.py", line 140, in main
    repos = __get_validated_git_repos__(set(args))
  File "/usr/local/lib/node_modules/gitinspector/gitinspector/gitinspector.py", line 121, in __get_validated_git_repos__
    cloned_repo.location = basedir.get_basedir_git(cloned_repo.location)
  File "/usr/local/lib/node_modules/gitinspector/gitinspector/basedir.py", line 35, in get_basedir_git
    os.chdir(path)
OSError: [Errno 2] No such file or directory: '/home/foxy/unexisting-folder'

This could be handles via an error message, so a simple exception catch would do the trick. I am willing to open a PR if necessary.