Skip to content

Commit b2643fc

Browse files
committed
Improved the Vercel build resilience:
installCommand now does find /vercel/path0 -maxdepth 3 -name requirements.txt and pipes the first match into pip install. No more guessing the working directory. buildCommand locates build.sh the same way, marks it executable, and runs it.
1 parent fa2f2b4 commit b2643fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vercel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
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",
2+
"installCommand": "echo 'Install step PWD:' $PWD && REQ=$(find /vercel/path0 -maxdepth 3 -name requirements.txt | head -n 1) && echo 'Using requirements file:' $REQ && python3 -m pip install -r $REQ",
3+
"buildCommand": "echo 'Build step PWD:' $PWD && BUILD_SCRIPT=$(find /vercel/path0 -maxdepth 3 -name build.sh | head -n 1) && echo 'Running build script:' $BUILD_SCRIPT && chmod +x $BUILD_SCRIPT && $BUILD_SCRIPT",
44
"outputDirectory": "site"
55
}

0 commit comments

Comments
 (0)