Closed gjtorikian closed 10 years ago
No, this wouldn't work for my use-case. Ideally, I'd be able to run jekyll build
anywhere on my filesystem. Might work better if you do the lookup relative to the build source.
Ahhhhh I got it. One sec.
Damn, this is apparently not an easy thing to do with Git. Pretty sure Dir.chdir
is a terrible idea here but there doesn't seem to be a way of finding out, externally, whether a folder is within a Git repo.
The alternative? Given a site
dir name, keep amending .git to the path and checking for it. If it's not there, pop up one directory level and do the same thing. Unsure which of these terrible ideas is less bad.
Dir.chdir
is not good to do without giving it a block:
# place A
Dir.chdir(source) do
# now I'm in the source!
end
# now I'm back to place A
Then we don't bork anything with Jekyll's directory discovery :)
@parkr If you can, would you let me know if the changes in this branch satisfy your use case?
Closes https://github.com/gjtorikian/jekyll-last-modified-at/issues/12
@parkr Would something like this work for your use case? In any event it tidies up the Git stuff and makes no assumptions about whether you're using Git at all.