Only install desktop, obsidian app from dev_setup.sh with --full flag

This commit is contained in:
Debanjum
2025-05-19 22:15:10 -07:00
parent 33dd4c8c33
commit fdb681ca0e
2 changed files with 32 additions and 16 deletions

View File

@@ -191,18 +191,19 @@ In whichever clients you're using for testing, you'll need to update the server
## Validate
### Before Making Changes
1. Install Git Hooks for Validation
1. Install Khoj. Setup Git Hooks for Validation
```shell
./scripts/dev_setup.sh
```
- This ensures standard code formatting fixes and other checks run automatically on every commit and push
- Installs the khoj server and web app by default. Use the `--full` flag to install the Khoj Desktop and Obsidian client apps as well.
- Git hooks format code, check types automatically on every commit and push respectively.
- Note 1: If [pre-commit](https://pre-commit.com/#intro) didn't already get installed, [install it](https://pre-commit.com/#install) via `pip install pre-commit`
- Note 2: To run the pre-commit changes manually, use `pre-commit run --hook-stage manual --all` before creating PR
### Before Creating PR
:::tip[Note]
You should be in an active virtual environment for Khoj in order to run the unit tests and linter.
You should be in an active virtual environment for Khoj in order to run the unit tests and linter. The `dev_setup.sh` script wil automatically create and activate it for you.
:::
1. Ensure that you have a [Github Issue](https://github.com/khoj-ai/khoj/issues) that can be linked to the PR. If not, create one. Make sure you've tagged one of the maintainers to the issue. This will ensure that the maintainers are notified of the PR and can review it. It's best discuss the code design on an existing issue or Discord thread before creating a PR. This helps get your PR merged faster.

View File

@@ -2,6 +2,24 @@
# ---
PROJECT_ROOT=$(git rev-parse --show-toplevel)
# Default to minimal installation unless --full flag passed
INSTALL_FULL=false
for arg in "$@"
do
if [ "$arg" == "--full" ]
then
INSTALL_FULL=true
break
fi
done
# Install Server App
# ---
echo "Installing Server App..."
cd $PROJECT_ROOT
# pip install --user pipenv && pipenv install -e '.[dev]' --skip-lock && pipenv shell
python3 -m venv .venv && . .venv/bin/activate && python3 -m pip install -e '.[dev]'
# Install Web App
# ---
echo "Installing Web App..."
@@ -10,22 +28,19 @@ yarn install
# Install Obsidian App
# ---
echo "Installing Obsidian App..."
cd $PROJECT_ROOT/src/interface/obsidian
yarn install
if [ "$INSTALL_FULL" = true ] ; then
echo "Installing Obsidian App..."
cd $PROJECT_ROOT/src/interface/obsidian
yarn install
fi
# Install Desktop App
# ---
echo "Installing Desktop App..."
cd $PROJECT_ROOT/src/interface/desktop
yarn install
# Install Server App
# ---
echo "Installing Server App..."
cd $PROJECT_ROOT
# pip install --user pipenv && pipenv install -e '.[dev]' --skip-lock && pipenv shell
python3 -m venv .venv && pip install -e '.[dev]' && . .venv/bin/activate
if [ "$INSTALL_FULL" = true ] ; then
echo "Installing Desktop App..."
cd $PROJECT_ROOT/src/interface/desktop
yarn install
fi
# Install pre-commit hooks
# ----