diff --git a/.github/actions/build-clio/action.yml b/.github/actions/build-clio/action.yml index 6fa94eef2..a1eccf580 100644 --- a/.github/actions/build-clio/action.yml +++ b/.github/actions/build-clio/action.yml @@ -26,6 +26,6 @@ runs: run: | cd build cmake \ - --build . \ - --parallel "${{ steps.nproc.outputs.nproc }}" \ - --target ${CMAKE_TARGETS} + --build . \ + --parallel "${{ steps.nproc.outputs.nproc }}" \ + --target ${CMAKE_TARGETS} diff --git a/.github/actions/cache-key/action.yml b/.github/actions/cache-key/action.yml index 54b45692d..a47b05163 100644 --- a/.github/actions/cache-key/action.yml +++ b/.github/actions/cache-key/action.yml @@ -38,4 +38,4 @@ runs: CODE_COVERAGE: ${{ inputs.code_coverage == 'true' && '-code_coverage' || '' }} CONAN_PROFILE: ${{ inputs.conan_profile }} run: | - echo "key=clio-ccache-${RUNNER_OS}-${BUILD_TYPE}${CODE_COVERAGE}-${CONAN_PROFILE}-develop" >> "${GITHUB_OUTPUT}" + echo "key=clio-ccache-${RUNNER_OS}-${BUILD_TYPE}${CODE_COVERAGE}-${CONAN_PROFILE}-develop" >>"${GITHUB_OUTPUT}" diff --git a/.github/actions/cmake/action.yml b/.github/actions/cmake/action.yml index 96898d704..3e5f925d3 100644 --- a/.github/actions/cmake/action.yml +++ b/.github/actions/cmake/action.yml @@ -76,16 +76,16 @@ runs: FORCE_CLIO_VERSION: ${{ inputs.version }} run: | cmake \ - -B "${BUILD_DIR}" \ - -S . \ - -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \ - -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ - "${SANITIZER_OPTION}" \ - -Dtests=ON \ - -Dintegration_tests="${INTEGRATION_TESTS}" \ - -Dbenchmark="${BENCHMARK}" \ - -Dcoverage="${COVERAGE}" \ - -Dstatic="${STATIC}" \ - -Dtime_trace="${TIME_TRACE}" \ - -Dpackage="${PACKAGE}" + -B "${BUILD_DIR}" \ + -S . \ + -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \ + -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ + "${SANITIZER_OPTION}" \ + -Dtests=ON \ + -Dintegration_tests="${INTEGRATION_TESTS}" \ + -Dbenchmark="${BENCHMARK}" \ + -Dcoverage="${COVERAGE}" \ + -Dstatic="${STATIC}" \ + -Dtime_trace="${TIME_TRACE}" \ + -Dpackage="${PACKAGE}" diff --git a/.github/actions/code-coverage/action.yml b/.github/actions/code-coverage/action.yml index aa16a6688..5612b1e07 100644 --- a/.github/actions/code-coverage/action.yml +++ b/.github/actions/code-coverage/action.yml @@ -15,13 +15,13 @@ runs: shell: bash run: | gcovr \ - -e benchmarks \ - -e tests \ - -e src/data/cassandra \ - -e src/data/CassandraBackend.hpp \ - -e 'src/data/BackendFactory.*' \ - --xml build/coverage_report.xml \ - -j8 --exclude-throw-branches + -e benchmarks \ + -e tests \ + -e src/data/cassandra \ + -e src/data/CassandraBackend.hpp \ + -e 'src/data/BackendFactory.*' \ + --xml build/coverage_report.xml \ + -j8 --exclude-throw-branches - name: Archive coverage report uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/.github/actions/conan/action.yml b/.github/actions/conan/action.yml index 897c3e548..1acf95e75 100644 --- a/.github/actions/conan/action.yml +++ b/.github/actions/conan/action.yml @@ -30,8 +30,8 @@ runs: CONAN_PROFILE: "${{ inputs.conan_profile }}" run: | conan \ - install . \ - -of "${BUILD_DIR}" \ - -b "${CONAN_BUILD_OPTION}" \ - -s "build_type=${BUILD_TYPE}" \ - --profile:all "${CONAN_PROFILE}" + install . \ + -of "${BUILD_DIR}" \ + -b "${CONAN_BUILD_OPTION}" \ + -s "build_type=${BUILD_TYPE}" \ + --profile:all "${CONAN_PROFILE}" diff --git a/.github/actions/git-common-ancestor/action.yml b/.github/actions/git-common-ancestor/action.yml index 1e7f16b58..54852b8e7 100644 --- a/.github/actions/git-common-ancestor/action.yml +++ b/.github/actions/git-common-ancestor/action.yml @@ -13,4 +13,4 @@ runs: id: find_common_ancestor shell: bash run: | - echo "commit=\"$(git merge-base --fork-point origin/develop)\"" >> $GITHUB_OUTPUT + echo "commit=\"$(git merge-base --fork-point origin/develop)\"" >>$GITHUB_OUTPUT diff --git a/.github/workflows/build-clio-docker-image.yml b/.github/workflows/build-clio-docker-image.yml index 0324f815a..8396c2afb 100644 --- a/.github/workflows/build-clio-docker-image.yml +++ b/.github/workflows/build-clio-docker-image.yml @@ -65,8 +65,8 @@ jobs: run: | wget "${BINARY_URL}" -P ./docker/clio/artifact/ if [ "$(sha256sum ./docker/clio/clio_server | awk '{print $1}')" != "${BINARY_SHA256}" ]; then - echo "Binary sha256 sum doesn't match" - exit 1 + echo "Binary sha256 sum doesn't match" + exit 1 fi - name: Unpack binary run: | @@ -74,9 +74,9 @@ jobs: cd docker/clio/artifact artifact=$(find . -type f) if [[ $artifact == *.zip ]]; then - unzip $artifact + unzip $artifact elif [[ $artifact == *.tar.gz ]]; then - tar -xvf $artifact + tar -xvf $artifact fi chmod +x ./clio_server mv ./clio_server ../ @@ -90,7 +90,7 @@ jobs: - name: Set GHCR_REPO id: set-ghcr-repo run: | - echo "GHCR_REPO=$(echo ghcr.io/${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_OUTPUT} + echo "GHCR_REPO=$(echo ghcr.io/${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >>${GITHUB_OUTPUT} - name: Build Docker image uses: ./.github/actions/build-docker-image diff --git a/.github/workflows/check-libxrpl.yml b/.github/workflows/check-libxrpl.yml index b85e53adb..d3bbef718 100644 --- a/.github/workflows/check-libxrpl.yml +++ b/.github/workflows/check-libxrpl.yml @@ -98,7 +98,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Create an issue - uses: XRPLF/actions/create-issue@fbcc16eb7f20dc3199eaf1aed0d3523a5ba9008c + uses: XRPLF/actions/create-issue@2b8bc36af85b88bca0dd7bfac2e2dc05f94ad712 with: title: "Proposed libXRPL check failed" body: > diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index 5eee18201..e519cb29d 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -7,4 +7,4 @@ on: jobs: check_title: - uses: XRPLF/actions/.github/workflows/check-pr-title.yml@a5d8dd35be543365e90a11358447130c8763871d + uses: XRPLF/actions/.github/workflows/check-pr-title.yml@cba1f0891650baf1a9c88624dc2d72573be2eb81 diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 16dc15e24..4315faa0b 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -44,7 +44,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} permissions: contents: read - uses: XRPLF/actions/.github/workflows/determine-tidy-files.yml@12f5dbc98a2260259a66970e57fa4d26fb7f285c + uses: XRPLF/actions/.github/workflows/determine-tidy-files.yml@224f3c48d3014d082a1129237b8291ff0b0a331f run-clang-tidy: name: Run clang tidy @@ -137,7 +137,7 @@ jobs: - name: Write issue header if: ${{ steps.run_clang_tidy.outcome != 'success' }} run: | - cat > "${ISSUE_FILE}" <"${ISSUE_FILE}" < filtered-output.txt || true + # Extract lines containing 'error:', 'warning:', or 'note:' + grep -E '(error:|warning:|note:)' "${OUTPUT_FILE}" >filtered-output.txt || true - # If filtered output is empty, use original (might be a different error format) - if [ ! -s filtered-output.txt ]; then - cp "${OUTPUT_FILE}" filtered-output.txt - fi + # If filtered output is empty, use original (might be a different error format) + if [ ! -s filtered-output.txt ]; then + cp "${OUTPUT_FILE}" filtered-output.txt + fi - # Truncate if too large - head -c 60000 filtered-output.txt >> "${ISSUE_FILE}" - if [ "$(wc -c < filtered-output.txt)" -gt 60000 ]; then - echo "" >> "${ISSUE_FILE}" - echo "... (output truncated, see artifacts for full output)" >> "${ISSUE_FILE}" - fi + # Truncate if too large + head -c 60000 filtered-output.txt >>"${ISSUE_FILE}" + if [ "$(wc -c >"${ISSUE_FILE}" + echo "... (output truncated, see artifacts for full output)" >>"${ISSUE_FILE}" + fi - rm filtered-output.txt + rm filtered-output.txt else - echo "No output file found" >> "${ISSUE_FILE}" + echo "No output file found" >>"${ISSUE_FILE}" fi - name: Append issue footer if: ${{ steps.run_clang_tidy.outcome != 'success' }} run: | - cat >> "${ISSUE_FILE}" <>"${ISSUE_FILE}" <> $GITHUB_OUTPUT + echo "date=$(date +'%Y%m%d')" >>$GITHUB_OUTPUT build-and-test: name: Build and Test @@ -172,7 +172,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Create an issue - uses: XRPLF/actions/create-issue@fbcc16eb7f20dc3199eaf1aed0d3523a5ba9008c + uses: XRPLF/actions/create-issue@2b8bc36af85b88bca0dd7bfac2e2dc05f94ad712 with: title: "Nightly release failed 🌙" body: "" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 9e25304e1..ccc351928 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,7 +8,7 @@ on: jobs: run-hooks: - uses: XRPLF/actions/.github/workflows/pre-commit.yml@5e942d61bf32f7557a7c159cfac4712a687b3e3a + uses: XRPLF/actions/.github/workflows/pre-commit.yml@cba1f0891650baf1a9c88624dc2d72573be2eb81 with: runs_on: heavy container: '{ "image": "ghcr.io/xrplf/clio-pre-commit:14342e087ceb8b593027198bf9ef06a43833c696" }' diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index e4d994f8a..f7bad83e2 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -149,7 +149,7 @@ jobs: if: ${{ inputs.analyze_build_time }} run: | ClangBuildAnalyzer --all build/ build_time_report.bin - ClangBuildAnalyzer --analyze build_time_report.bin > build_time_report.txt + ClangBuildAnalyzer --analyze build_time_report.bin >build_time_report.txt cat build_time_report.txt - name: Upload build time analyze report @@ -227,13 +227,13 @@ jobs: set -e EXPECTED_VERSION="clio-${INPUT_VERSION}" if [[ "${BUILD_TYPE}" == "Debug" ]]; then - EXPECTED_VERSION="${EXPECTED_VERSION}+DEBUG" + EXPECTED_VERSION="${EXPECTED_VERSION}+DEBUG" fi actual_version=$(./build/clio_server --version | head -n 1) if [[ "${actual_version}" != "${EXPECTED_VERSION}" ]]; then - echo "Expected version '${EXPECTED_VERSION}', but got '${actual_version}'" - exit 1 + echo "Expected version '${EXPECTED_VERSION}', but got '${actual_version}'" + exit 1 fi # `codecov/codecov-action` will rerun `gcov` if it's available and build directory is present diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 80aacaacb..98f56ae98 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -81,9 +81,9 @@ jobs: env: RELEASE_HEADER: ${{ inputs.header }} run: | - echo "# Release notes" > "${RUNNER_TEMP}/release_notes.md" - echo "" >> "${RUNNER_TEMP}/release_notes.md" - printf '%s\n' "${RELEASE_HEADER}" >> "${RUNNER_TEMP}/release_notes.md" + echo "# Release notes" >"${RUNNER_TEMP}/release_notes.md" + echo "" >>"${RUNNER_TEMP}/release_notes.md" + printf '%s\n' "${RELEASE_HEADER}" >>"${RUNNER_TEMP}/release_notes.md" - name: Generate changelog if: ${{ inputs.generate_changelog }} @@ -91,7 +91,7 @@ jobs: LAST_TAG="$(gh release view --json tagName -q .tagName --repo XRPLF/clio)" LAST_TAG_COMMIT="$(git rev-parse $LAST_TAG)" BASE_COMMIT="$(git merge-base HEAD $LAST_TAG_COMMIT)" - git-cliff "${BASE_COMMIT}..HEAD" --ignore-tags "nightly|-b|-rc" >> "${RUNNER_TEMP}/release_notes.md" + git-cliff "${BASE_COMMIT}..HEAD" --ignore-tags "nightly|-b|-rc" >>"${RUNNER_TEMP}/release_notes.md" - name: Upload release notes uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 @@ -106,10 +106,10 @@ jobs: run: | RELEASES_TO_DELETE=$(gh release list --limit 50 --repo "${GH_REPO}" | grep -E "${DELETE_PATTERN}" | awk -F'\t' '{print $3}' || true) if [ -n "$RELEASES_TO_DELETE" ]; then - for RELEASE in $RELEASES_TO_DELETE; do - echo "Deleting release: $RELEASE" - gh release delete "$RELEASE" --repo "${GH_REPO}" --yes --cleanup-tag - done + for RELEASE in $RELEASES_TO_DELETE; do + echo "Deleting release: $RELEASE" + gh release delete "$RELEASE" --repo "${GH_REPO}" --yes --cleanup-tag + done fi - name: Publish release @@ -121,9 +121,9 @@ jobs: DRAFT_OPTION: ${{ inputs.draft && '--draft' || '' }} run: | gh release create "${RELEASE_VERSION}" \ - ${PRERELEASE_OPTION} \ - --title "${RELEASE_TITLE}" \ - --target "${GITHUB_SHA}" \ - ${DRAFT_OPTION} \ - --notes-file "${RUNNER_TEMP}/release_notes.md" \ - ./release_artifacts/clio_* + ${PRERELEASE_OPTION} \ + --title "${RELEASE_TITLE}" \ + --target "${GITHUB_SHA}" \ + ${DRAFT_OPTION} \ + --notes-file "${RUNNER_TEMP}/release_notes.md" \ + ./release_artifacts/clio_* diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index f635d59ad..3e2b976c7 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -68,7 +68,7 @@ jobs: - name: Create an issue if: ${{ steps.run_clio_tests.outcome == 'failure' && endsWith(inputs.conan_profile, 'san') }} - uses: XRPLF/actions/create-issue@fbcc16eb7f20dc3199eaf1aed0d3523a5ba9008c + uses: XRPLF/actions/create-issue@2b8bc36af85b88bca0dd7bfac2e2dc05f94ad712 with: title: "[${{ inputs.conan_profile }}] reported issues" body: "Clio tests failed one or more sanitizer checks when built with `${{ inputs.conan_profile }}`." @@ -112,22 +112,22 @@ jobs: timeout-minutes: 1 run: | docker run \ - --detach \ - --name scylladb \ - --health-cmd "cqlsh -e 'describe cluster'" \ - --health-interval 10s \ - --health-timeout 5s \ - --health-retries 5 \ - --publish 9042:9042 \ - --memory 16G \ - scylladb/scylla + --detach \ + --name scylladb \ + --health-cmd "cqlsh -e 'describe cluster'" \ + --health-interval 10s \ + --health-timeout 5s \ + --health-retries 5 \ + --publish 9042:9042 \ + --memory 16G \ + scylladb/scylla - name: Wait for scylladb container to be healthy (macOS) if: ${{ runner.os == 'macOS' }} timeout-minutes: 1 run: | until [ "$(docker inspect -f '{{.State.Health.Status}}' scylladb)" == "healthy" ]; do - sleep 1 + sleep 1 done - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 diff --git a/.github/workflows/update-docker-ci.yml b/.github/workflows/update-docker-ci.yml index 182f8e039..4a80b4eb1 100644 --- a/.github/workflows/update-docker-ci.yml +++ b/.github/workflows/update-docker-ci.yml @@ -48,7 +48,7 @@ jobs: - name: Set GHCR_REPO id: set-ghcr-repo run: | - echo "GHCR_REPO=$(echo ghcr.io/${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_OUTPUT} + echo "GHCR_REPO=$(echo ghcr.io/${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >>${GITHUB_OUTPUT} gcc-amd64: name: Build and push GCC docker image (amd64) @@ -162,19 +162,19 @@ jobs: if: ${{ github.event_name != 'pull_request' && steps.changed-files.outputs.any_changed == 'true' }} run: | push_image() { - image=$1 + image=$1 - docker buildx imagetools create \ - -t $image:latest \ - -t $image:${{ env.GCC_MAJOR_VERSION }} \ - -t $image:${{ env.GCC_VERSION }} \ - -t $image:${{ github.sha }} \ - $image:arm64-latest \ - $image:amd64-latest + docker buildx imagetools create \ + -t $image:latest \ + -t $image:${{ env.GCC_MAJOR_VERSION }} \ + -t $image:${{ env.GCC_VERSION }} \ + -t $image:${{ github.sha }} \ + $image:arm64-latest \ + $image:amd64-latest } push_image ${{ needs.repo.outputs.GHCR_REPO }}/clio-gcc if [[ ${{ github.repository }} == 'XRPLF/clio' ]]; then - push_image rippleci/clio_clang + push_image rippleci/clio_clang fi clang: @@ -305,10 +305,10 @@ jobs: run: | image=${{ needs.repo.outputs.GHCR_REPO }}/clio-tools docker buildx imagetools create \ - -t $image:latest \ - -t $image:${{ github.sha }} \ - $image:arm64-latest \ - $image:amd64-latest + -t $image:latest \ + -t $image:${{ github.sha }} \ + $image:arm64-latest \ + $image:amd64-latest pre-commit: name: Build and push pre-commit docker image diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index b630f00c9..0eaea4032 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -56,7 +56,7 @@ jobs: - name: Calculate conan matrix id: set-matrix - run: .github/scripts/conan/generate_matrix.py >> "${GITHUB_OUTPUT}" + run: .github/scripts/conan/generate_matrix.py >>"${GITHUB_OUTPUT}" upload-conan-deps: name: Build ${{ matrix.compiler }}${{ matrix.sanitizer_ext }} ${{ matrix.build_type }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 584c11b47..2adca7e40 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,7 +67,7 @@ repos: rev: 05c1426671b9237fb5e1444dd63aa5731bec0dfb # frozen: v3.13.1-1 hooks: - id: shfmt - args: ["-i", "4", "--write"] + args: [--write, --indent=4, --case-indent=true] # Running some C++ hooks before clang-format # to ensure that the style is consistent. diff --git a/cmake/pkg/postinst b/cmake/pkg/postinst index d10353d9b..6f802fdbe 100755 --- a/cmake/pkg/postinst +++ b/cmake/pkg/postinst @@ -10,36 +10,36 @@ CLIO_BIN="$CLIO_PREFIX/bin/${CLIO_EXECUTABLE}" CLIO_CONFIG="$CLIO_PREFIX/etc/config.json" case "$1" in -configure) - if ! id -u "$USER_NAME" >/dev/null 2>&1; then - # Users who should not have a home directory should have their home directory set to /nonexistent - # https://www.debian.org/doc/debian-policy/ch-opersys.html#non-existent-home-directories - useradd \ - --system \ - --home-dir /nonexistent \ - --no-create-home \ - --shell /usr/sbin/nologin \ - --comment "system user for ${CLIO_EXECUTABLE}" \ - --user-group \ - ${USER_NAME} - fi + configure) + if ! id -u "$USER_NAME" >/dev/null 2>&1; then + # Users who should not have a home directory should have their home directory set to /nonexistent + # https://www.debian.org/doc/debian-policy/ch-opersys.html#non-existent-home-directories + useradd \ + --system \ + --home-dir /nonexistent \ + --no-create-home \ + --shell /usr/sbin/nologin \ + --comment "system user for ${CLIO_EXECUTABLE}" \ + --user-group \ + ${USER_NAME} + fi - install -d -o "$USER_NAME" -g "$GROUP_NAME" /var/log/clio + install -d -o "$USER_NAME" -g "$GROUP_NAME" /var/log/clio - if [ -f "$CLIO_CONFIG" ]; then - chown "$USER_NAME:$GROUP_NAME" "$CLIO_CONFIG" - fi + if [ -f "$CLIO_CONFIG" ]; then + chown "$USER_NAME:$GROUP_NAME" "$CLIO_CONFIG" + fi - chown -R "$USER_NAME:$GROUP_NAME" "$CLIO_PREFIX" + chown -R "$USER_NAME:$GROUP_NAME" "$CLIO_PREFIX" - ln -sf "$CLIO_BIN" "/usr/bin/${CLIO_EXECUTABLE}" + ln -sf "$CLIO_BIN" "/usr/bin/${CLIO_EXECUTABLE}" - ;; -abort-upgrade | abort-remove | abort-deconfigure) ;; -*) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; + ;; + abort-upgrade | abort-remove | abort-deconfigure) ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; esac exit 0 diff --git a/docker/develop/run b/docker/develop/run index 88518f14e..2c4cd12eb 100755 --- a/docker/develop/run +++ b/docker/develop/run @@ -41,26 +41,26 @@ EOF } case $1 in --h | --help) - print_help - ;; + -h | --help) + print_help + ;; --t | --terminal) - open_terminal - ;; + -t | --terminal) + open_terminal + ;; --s | --stop) - stop_container - ;; + -s | --stop) + stop_container + ;; --*) - echo "Unknown option: $1" - print_help - ;; + -*) + echo "Unknown option: $1" + print_help + ;; -*) - run "$@" - ;; + *) + run "$@" + ;; esac popd >/dev/null