Add shell check to pre-cmmit hooks & fix issues reported by it (#2579)

This commit is contained in:
Asher Foa
2025-06-03 13:37:56 -04:00
committed by GitHub
parent 2ddcb9eb0b
commit d09c1c865c
6 changed files with 14 additions and 10 deletions

View File

@@ -97,3 +97,8 @@ repos:
entry: ./run_alembic_check.sh entry: ./run_alembic_check.sh
language: script language: script
stages: [ manual ] stages: [ manual ]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck

View File

@@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
set -e set -e

View File

@@ -1,11 +1,10 @@
#!/bin/bash #!/bin/bash
set -e set -e
# setting api key # setting api key
export VITE_SKYVERN_API_KEY=$(sed -n 's/.*cred\s*=\s*"\([^"]*\)".*/\1/p' .streamlit/secrets.toml) VITE_SKYVERN_API_KEY=$(sed -n 's/.*cred\s*=\s*"\([^"]*\)".*/\1/p' .streamlit/secrets.toml)
export VITE_SKYVERN_API_KEY
npm run start npm run start

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# first apply migrations # first apply migrations
export PATH=$PATH:.venv/bin export PATH="${PATH}:.venv/bin"
alembic upgrade head alembic upgrade head
# then check if the database is up to date with the models # then check if the database is up to date with the models
alembic check alembic check

View File

@@ -1,14 +1,15 @@
#!/bin/bash #!/bin/bash
pid=$(lsof -t -i :8000) pid=$(lsof -t -i :8000)
if [ ! -z "$pid" ]; then if [ -n "$pid" ]; then
kill $pid kill "$pid"
fi fi
if [ ! -f .env ]; then if [ ! -f .env ]; then
cp .env.example .env cp .env.example .env
echo "Please add your api keys to the .env file." echo "Please add your api keys to the .env file."
fi fi
# shellcheck source=/dev/null
source "$(poetry env info --path)/bin/activate" source "$(poetry env info --path)/bin/activate"
poetry install poetry install
./run_alembic_check.sh ./run_alembic_check.sh

View File

@@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
pid=$(lsof -t -i :8080) pid=$(lsof -t -i :8080)
if [ ! -z "$pid" ]; then if [ -n "$pid" ]; then
kill $pid kill "$pid"
fi fi
cd skyvern-frontend cd skyvern-frontend || exit 1
if [ ! -f .env ]; then if [ ! -f .env ]; then
cp .env.example .env cp .env.example .env