Mercurial > code > home > repos > rdferry
diff precommit.sh @ 0:fa108e01b284
start
author | drewp@bigasterisk.com |
---|---|
date | Fri, 15 Mar 2024 18:37:20 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/precommit.sh Fri Mar 15 18:37:20 2024 -0700 @@ -0,0 +1,30 @@ +#!/bin/bash +exit 0 + +# Define your project's root directory +PROJECT_ROOT="/path/to/your/project" + +# Change directory to the project root +cd "$PROJECT_ROOT" || exit + +# Install dependencies using pdm +pdm install + +# Check if the installation was successful +if [ $? -ne 0 ]; then + echo "Error: Failed to install dependencies with pdm." + exit 1 +fi + +# Run your code +# Modify the command as per your project structure and requirements +python your_script.py + +# Check if the execution was successful +if [ $? -ne 0 ]; then + echo "Error: Failed to run your code." + exit 1 +fi + +# If everything is successful, exit with 0 status +exit 0