Skip to content

Commit 94ec350

Browse files
authored
add post create script to automate more of setup (run-llama#98)
1 parent eac2260 commit 94ec350

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.devcontainer/devcontainer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
1212
"ghcr.io/devcontainers/features/aws-cli:1": {},
1313
"ghcr.io/devcontainers/features/node:1": {}
14-
}
14+
},
15+
"postCreateCommand": "bash .devcontainer/post_create_command.sh"
1516
}

.devcontainer/post_create_command.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cd backend/
2+
3+
# install poetry dependencies
4+
poetry install
5+
6+
cp .env.development .env
7+
set -a
8+
source .env
9+
make migrate

backend/scripts/download_sec_pdf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def _convert_to_pdf(output_dir: str):
7878
input_path = str(filing_doc.absolute())
7979
output_path = str(filing_pdf.absolute())
8080
try:
81-
pdfkit.from_file(input_path, output_path, verbose=True)
81+
# fix for issue here:
82+
# https://github.com/wkhtmltopdf/wkhtmltopdf/issues/4460#issuecomment-661345113
83+
options = {'enable-local-file-access': None}
84+
pdfkit.from_file(input_path, output_path, options=options, verbose=True)
8285
except Exception as e:
8386
print(f"Error converting {input_path} to {output_path}: {e}")
8487

0 commit comments

Comments
 (0)