mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
fixes
This commit is contained in:
parent
94b31f8846
commit
9f87d67849
4 changed files with 180 additions and 8 deletions
|
|
@ -5,9 +5,34 @@
|
|||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
#
|
||||
# Pass --target-root to direct generated artifacts into an alternate checkout
|
||||
# (used by the trusted autofix workflow running from a base-branch worktree).
|
||||
|
||||
PYTHONPATH=${PYTHONPATH:-}
|
||||
THIS_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
||||
SOURCE_STACK_DIR="$(dirname "$(dirname "$THIS_DIR")")"
|
||||
TARGET_STACK_DIR="$SOURCE_STACK_DIR"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--target-root)
|
||||
shift
|
||||
if [[ $# -eq 0 ]]; then
|
||||
echo "Error: --target-root requires a value" >&2
|
||||
exit 1
|
||||
fi
|
||||
TARGET_STACK_DIR="$1"
|
||||
;;
|
||||
*)
|
||||
echo "Error: unknown argument '$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
TARGET_STATIC_DIR="$TARGET_STACK_DIR/docs/openapi_generator/static"
|
||||
TARGET_SPEC_PATH="$TARGET_STACK_DIR/client-sdks/stainless/openapi.yml"
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
|
@ -27,8 +52,10 @@ if [ ${#missing_packages[@]} -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
stack_dir=$(dirname $(dirname $THIS_DIR))
|
||||
PYTHONPATH=$PYTHONPATH:$stack_dir \
|
||||
python -m docs.openapi_generator.generate $(dirname $THIS_DIR)/static
|
||||
mkdir -p "$TARGET_STATIC_DIR"
|
||||
mkdir -p "$(dirname "$TARGET_SPEC_PATH")"
|
||||
|
||||
cp $stack_dir/docs/static/stainless-llama-stack-spec.yaml $stack_dir/client-sdks/stainless/openapi.yml
|
||||
PYTHONPATH="$TARGET_STACK_DIR:$TARGET_STACK_DIR/src:$PYTHONPATH" \
|
||||
python "$SOURCE_STACK_DIR/docs/openapi_generator/generate.py" "$TARGET_STATIC_DIR"
|
||||
|
||||
cp "$TARGET_STACK_DIR/docs/static/stainless-llama-stack-spec.yaml" "$TARGET_SPEC_PATH"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue