From d13609c45372376838c8e4b11e2d45f509e60589 Mon Sep 17 00:00:00 2001 From: Eser Deniz Date: Tue, 30 Jun 2026 09:53:56 +0000 Subject: [PATCH] Fix cpx execution --- .github/workflows/test.yml | 7 +++++++ README.md | 5 +++++ bin/publicip | 15 +++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1616a52..a237241 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,3 +57,10 @@ jobs: - name: Run tests run: ./vendor/bin/pest + + - name: Test cpx execution + if: matrix.os == 'ubuntu-latest' && matrix.php == '8.4' + run: | + composer global require cpx/cpx --no-interaction --prefer-dist + export PATH="$COMPOSER_HOME/vendor/bin:$PATH" + cpx knotsphp/publicip:dev-${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}} --help diff --git a/README.md b/README.md index 4f8bb20..a13e4c3 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,11 @@ It's recommended to install the library globally to use it in the command line. composer global require knotsphp/publicip ``` +Or run it without installing globally via [cpx](https://github.com/laravel/cpx): +```bash +cpx knotsphp/publicip +``` + Then you can use the `publicip` command to get the public IP address of the current machine. ```bash # In your project directory diff --git a/bin/publicip b/bin/publicip index 2ed0176..dbc0183 100755 --- a/bin/publicip +++ b/bin/publicip @@ -1,10 +1,17 @@ #!/usr/bin/env php