2024-02-17 18:59:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Copyright 2009-2024 Joshua Bronson. All rights reserved.
|
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2023-10-01 19:01:48 +00:00
|
|
|
|
2024-02-17 18:59:45 +00:00
|
|
|
# shellcheck disable=SC1091
|
2023-10-01 19:01:48 +00:00
|
|
|
|
2024-02-17 18:59:45 +00:00
|
|
|
set -euo pipefail
|
2023-12-30 17:06:05 +00:00
|
|
|
|
2024-01-13 18:36:43 +00:00
|
|
|
declare -r hint="Hint: Use 'nix develop' to bootstrap a development environment"
|
2023-12-30 17:06:05 +00:00
|
|
|
|
2024-10-05 13:34:33 +00:00
|
|
|
for cmd in uv pre-commit; do
|
2024-02-17 18:59:45 +00:00
|
|
|
if ! type "$cmd"; then
|
|
|
|
>&2 echo "Error: No '$cmd' on PATH. $hint"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
2023-12-30 17:06:05 +00:00
|
|
|
pre-commit install -f
|
|
|
|
|
2024-11-02 20:14:03 +00:00
|
|
|
uv sync
|
|
|
|
echo "Development virtualenv initialized and activated"
|