Error when checking for hugo in docker
opened this issue · comments
I'm trying to use Academic to import my publications from a bibtex file but it turns out that the latest addition to check for a docker file breaks the script for me.
I get the following error:
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\Scripts\academic-script.py", line 9, in <module>
sys.exit(main())
File "C:\ProgramData\Miniconda3\lib\site-packages\academic\cli.py", line 43, in main
parse_args(sys.argv[1:]) # Strip command name, leave just args.
File "C:\ProgramData\Miniconda3\lib\site-packages\academic\cli.py", line 101, in parse_args
import_bibtex(
File "C:\ProgramData\Miniconda3\lib\site-packages\academic\import_bibtex.py", line 55, in import_bibtex
parse_bibtex_entry(
File "C:\ProgramData\Miniconda3\lib\site-packages\academic\import_bibtex.py", line 100, in parse_bibtex_entry
page.load("index.md")
File "C:\ProgramData\Miniconda3\lib\site-packages\academic\editFM.py", line 23, in load
file = open(self.path, "r").readlines()
FileNotFoundError: [Errno 2] No such file or directory: 'content\\publication\\hill-life-2020\\index.md'
I am using Miniconda as my Python environment and I do have Docker installed and running in the background, but I do not have a docker-compose.yml file in the current directory that I am working in. I am running on Windows 10.
Commenting out the lines 8 - 11 in the function hugo_in_docker_or_local()
in utils.py
and just leaving hugo = ""
allows the script to work for me.
Thanks for reporting this.
The bug appears to be related to #68 - perhaps you and/or @ionlights can submit a PR to fix?
Does arichardson@ff11308 fix this issue? I saw similar problems.
Opened as #71
@arichardson Sorry about that! 😅 I guess I glossed over that when I was making my PR. That ought to fix it. It's supposed to fall back to a regular hugo
command if no docker-compose.yml
is present.