diff --git a/post-checkout b/post-checkout index 97b6086..8f4fc92 100755 --- a/post-checkout +++ b/post-checkout @@ -24,7 +24,7 @@ # Configuration TOOL_NAME="Luca" TOOL_FOLDER=".luca" -LUCAFILE="Lucafile" +SPEC_NAMES="Lucafile Lucafile.yml Toolfile Toolfile.yml Skillfile Skillfile.yml" INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/LucaTools/LucaScripts/HEAD/install.sh" # ============================================================================= @@ -106,15 +106,22 @@ if [ -z "$REPO_ROOT" ]; then fi VERSION_FILE="$REPO_ROOT/.luca-version" -LUCAFILE_PATH="$REPO_ROOT/$LUCAFILE" -# Only proceed if Lucafile exists -if [ ! -f "$LUCAFILE_PATH" ]; then - # No Lucafile in this repository, nothing to do +# Only proceed if a recognised spec file exists +FOUND_SPEC="" +for name in $SPEC_NAMES; do + if [ -f "$REPO_ROOT/$name" ]; then + FOUND_SPEC="$name" + break + fi +done + +if [ -z "$FOUND_SPEC" ]; then + # No spec file in this repository, nothing to do exit 0 fi -log_info "Found $LUCAFILE, synchronizing tools..." +log_info "Found $FOUND_SPEC, synchronizing tools..." # ============================================================================= # LUCA INSTALLATION CHECK @@ -150,14 +157,14 @@ fi # TOOL INSTALLATION FROM LUCAFILE # ============================================================================= -log_info "Installing CLI tools from $LUCAFILE..." +log_info "Installing CLI tools from $FOUND_SPEC..." # Change to repo root to ensure correct context cd "$REPO_ROOT" || exit 1 -# Install tools specified in Lucafile +# Install tools specified in the spec file if is_luca_installed; then - luca install --quiet --spec "$LUCAFILE" + luca install --quiet INSTALL_RESULT=$? if [ $INSTALL_RESULT -eq 0 ]; then diff --git a/tests/post_checkout.bats b/tests/post_checkout.bats index 63aec08..1225b62 100644 --- a/tests/post_checkout.bats +++ b/tests/post_checkout.bats @@ -113,7 +113,7 @@ setup() { assert_success assert_output --partial "Tools synchronized successfully" - run grep "luca install --quiet --spec Lucafile" "$MOCK_LUCA_CALL_LOG" + run grep "luca install --quiet" "$MOCK_LUCA_CALL_LOG" assert_success }