Skip to content

Commit fa2f2b4

Browse files
committed
runs reliably whether Vercel starts inside /site or at the repo root:
installCommand  – If requirements.txt is in the current directory, install normally.  – Otherwise it jumps up one level (the real project root) and installs from there. buildCommand  – Same logic for build.sh: run in place if it’s there, or cd .. and run.
1 parent b3be52f commit fa2f2b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vercel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"installCommand": "echo $PWD && ls -al && python3 -m pip install -r requirements.txt",
3-
"buildCommand": "echo $PWD && ls -al && ./build.sh",
2+
"installCommand": "echo 'Install step PWD:' $PWD && if [ -f requirements.txt ]; then ls -al && python3 -m pip install -r requirements.txt ; else echo 'requirements.txt not found, moving to project root' && cd .. && ls -al && python3 -m pip install -r requirements.txt ; fi",
3+
"buildCommand": "echo 'Build step PWD:' $PWD && if [ -f build.sh ]; then ls -al && ./build.sh ; else echo 'build.sh not found in current directory, moving to project root' && cd .. && ls -al && ./build.sh ; fi",
44
"outputDirectory": "site"
55
}

0 commit comments

Comments
 (0)