Skip to content

Commit

Permalink
feat(scripts): Add a script to generate all CLI completion scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 9, 2024
1 parent 3a68e61 commit 94e30b1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions scripts/generate_completion_scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Copyright (C) 2024 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE

GIT_ROOT=$(git rev-parse --show-toplevel)

(cd $GIT_ROOT &&
./gradlew -q :cli:installDist &&
cli/build/install/ort/bin/ort --generate-completion=bash > integrations/completions/ort-completion.bash &&
cli/build/install/ort/bin/ort --generate-completion=fish > integrations/completions/ort-completion.fish &&
cli/build/install/ort/bin/ort --generate-completion=zsh > integrations/completions/ort-completion.zsh
)

0 comments on commit 94e30b1

Please sign in to comment.