Add shell check to pre-cmmit hooks & fix issues reported by it (#2579)
This commit is contained in:
@@ -97,3 +97,8 @@ repos:
|
||||
entry: ./run_alembic_check.sh
|
||||
language: script
|
||||
stages: [ manual ]
|
||||
- repo: https://github.com/koalaman/shellcheck-precommit
|
||||
rev: v0.10.0
|
||||
hooks:
|
||||
- id: shellcheck
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
# first apply migrations
|
||||
export PATH=$PATH:.venv/bin
|
||||
export PATH="${PATH}:.venv/bin"
|
||||
alembic upgrade head
|
||||
# then check if the database is up to date with the models
|
||||
alembic check
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
pid=$(lsof -t -i :8000)
|
||||
if [ ! -z "$pid" ]; then
|
||||
kill $pid
|
||||
if [ -n "$pid" ]; then
|
||||
kill "$pid"
|
||||
fi
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
cp .env.example .env
|
||||
echo "Please add your api keys to the .env file."
|
||||
fi
|
||||
# shellcheck source=/dev/null
|
||||
source "$(poetry env info --path)/bin/activate"
|
||||
poetry install
|
||||
./run_alembic_check.sh
|
||||
|
||||
Reference in New Issue
Block a user