From 680a250119f4c7ac3d36460ad3a896b4bf13c655 Mon Sep 17 00:00:00 2001 From: Nikita Kodenko Date: Wed, 2 Oct 2019 22:13:00 +0700 Subject: [PATCH 1/2] scripts: bash completion included in deb/rpm packages Fixes #2181 --- scripts/build_posix.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/build_posix.sh b/scripts/build_posix.sh index b61a408f8..1e50b114f 100755 --- a/scripts/build_posix.sh +++ b/scripts/build_posix.sh @@ -17,6 +17,7 @@ BUILD_DIR=build BIN_DIR=$BUILD_DIR/$INSTALL_DIR/bin DESC='Data Version Control - datasets, models, and experiments versioning for ML or data science projects' LIB_DIR=$BUILD_DIR/$INSTALL_DIR/lib +CMPLT_DIR=etc/bash_completion.d print_error() { @@ -51,6 +52,7 @@ fpm_build() $FPM_FLAGS \ -n dvc \ -v $VERSION \ + --config-files $CMPLT_DIR/dvc \ -C $BUILD_DIR usr } @@ -58,6 +60,7 @@ cleanup() { print_info "Cleaning up..." rm -rf build + rm -rf $CMPLT_DIR } install_dependencies() @@ -106,6 +109,11 @@ build_dvc() popd $BIN_DIR/dvc --help fi + + if [[ "$(uname)" == 'Linux' ]]; then + mkdir -p $CMPLT_DIR + cp scripts/completion/dvc.bash $CMPLT_DIR/dvc + fi } cleanup From b1e56896d6c9921b1fe7f062060a7042063c416c Mon Sep 17 00:00:00 2001 From: Nikita Kodenko Date: Fri, 4 Oct 2019 01:09:56 +0700 Subject: [PATCH 2/2] Completion script for MacOS --- scripts/build_posix.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/build_posix.sh b/scripts/build_posix.sh index 1e50b114f..84ad522b8 100755 --- a/scripts/build_posix.sh +++ b/scripts/build_posix.sh @@ -17,7 +17,14 @@ BUILD_DIR=build BIN_DIR=$BUILD_DIR/$INSTALL_DIR/bin DESC='Data Version Control - datasets, models, and experiments versioning for ML or data science projects' LIB_DIR=$BUILD_DIR/$INSTALL_DIR/lib -CMPLT_DIR=etc/bash_completion.d + +if [[ "$(uname)" == 'Linux' ]]; then + CMPLT_DIR=etc/bash_completion.d + FPM_PACKAGE_DIRS="usr etc" +else + CMPLT_DIR=usr/local/etc/bash_completion.d + FPM_PACKAGE_DIRS="usr" +fi print_error() { @@ -52,15 +59,14 @@ fpm_build() $FPM_FLAGS \ -n dvc \ -v $VERSION \ - --config-files $CMPLT_DIR/dvc \ - -C $BUILD_DIR usr + -C $BUILD_DIR \ + $FPM_PACKAGE_DIRS } cleanup() { print_info "Cleaning up..." rm -rf build - rm -rf $CMPLT_DIR } install_dependencies() @@ -110,10 +116,8 @@ build_dvc() $BIN_DIR/dvc --help fi - if [[ "$(uname)" == 'Linux' ]]; then - mkdir -p $CMPLT_DIR - cp scripts/completion/dvc.bash $CMPLT_DIR/dvc - fi + mkdir -p $BUILD_DIR/$CMPLT_DIR + cp scripts/completion/dvc.bash $BUILD_DIR/$CMPLT_DIR/dvc } cleanup