PNHP / Regional_SDM

Methods and collaboration for Species Distribution Modeling among Heritage Programs
3 stars 0 forks source link

get_scripts.R not able to open repository #20

Closed ChristopherTracey closed 6 years ago

ChristopherTracey commented 6 years ago

This error keeps popping up:

Error in validObject(.Object) : invalid class “git_repository” object: Unable to open repository at 'path'

Upgraded R, packages, etc and the same error persists.

dnbucklin commented 6 years ago

I think this is from the git2r::repository function. It would happen if you already have a folder named Regional_SDM_[datestamp] in the folder you specify for loc_scripts, but that folder is not initialized as a git repository (just a regular folder).

You could either rename/move that existing Regional_SDM_[datestamp] folder, or just specify a new empty folder for loc_scripts.

dnbucklin commented 6 years ago

Ok, my fix for this (b010a10d62cd6298aeca38981963f6e109a12779) was just to ignore these non-git folders. So now when you run helper/get_scripts.R, and the latest Regional_SDM_YYYY_MM_DD folder it finds is not a git repo, it will ignore it and create a new git repo with the current date, and return this new folder path to move forward with as loc_scripts.

Also note that I changed the path to get_scripts in user_run_SDM to it's path in the git repo (in the helper sub-folder).