From b24e8e898c0c3415d6017a214407f7a914ce8da0 Mon Sep 17 00:00:00 2001 From: tyler36 Date: Tue, 7 Feb 2023 09:31:49 +0900 Subject: [PATCH] command runs "per-project" (#42) * command runs "per-project" * add note if global command is detected * Add env for running tests against HEAD * Update README.md Co-authored-by: Matt Stein * Update README.md Co-authored-by: Matt Stein * Update README.md Co-authored-by: Matt Stein * Update README.md Co-authored-by: Matt Stein * Update README.md Co-authored-by: Matt Stein --------- Co-authored-by: tyler36 <7234392+tyler36@users.noreply.github.com> Co-authored-by: Matt Stein --- .github/workflows/tests.yml | 2 ++ README.md | 13 ++++++++++++- install.yaml | 12 +++++++----- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 541a4e4..8e42349 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,8 @@ env: NIGHTLY_DDEV_PR_URL: "https://nightly.link/ddev/ddev/actions/runs/1720215802/ddev-linux-amd64.zip" # Allow ddev get to use a github token to prevent rate limiting by tests DDEV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Allow `--HEAD` flag when running tests against HEAD + HOMEBREW_NO_INSTALL_FROM_API: 1 jobs: tests: diff --git a/README.md b/README.md index 0ab3982..68c4a06 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,24 @@ NOTE: The browsersync'd URL is ***HTTPS***, not HTTP. ddev-router redirects traf EG. "External: " => Access on **** + +> :bulb: This add-on moves to a per-project approach in v2.5.0+. You can safely delete the global `~/.ddev/commands/web/browsersync` once you’re on v2.5.0 or higher—this will not affect usage. + + +If you run `ddev browsersync` from a local project and get `Error: unknown command "browsersync" for "ddev"`, run the following to add the command to the project: + + ```shell + ddev get ddev/ddev-browsersync + ``` + + ## What does this add-on do and add? 1. Checks to make sure the DDEV version is adequate. 2. Adds `.ddev/web-build/Dockerfile.ddev-browsersync`, which installs browsersync using npm. 3. Adds a `browser-sync.js` to define the operation of the base setup. 4. Adds a `.ddev/docker-compose.browsersync.yaml`, which exposes and routes the ports necessary. -5. Adds a `ddev browsersync` shell command globally, which lets you easily start browsersync when you want it. +5. Adds a `ddev browsersync` shell command, which lets you easily start browsersync when you want it. ## Other ways to use browsersync with this add-on diff --git a/install.yaml b/install.yaml index 4a5fd0f..91eff54 100644 --- a/install.yaml +++ b/install.yaml @@ -1,7 +1,7 @@ name: ddev-browsersync pre_install_actions: -- | +- | #ddev-nodisplay #ddev-description:Check for minimum DDEV requirement (v1.19.3) if ! ( ddev debug capabilities 2>/dev/null | grep multiple-dockerfiles >/dev/null 2>&1 ) ; then @@ -12,11 +12,13 @@ project_files: - docker-compose.browsersync.yaml - web-build/Dockerfile.ddev-browsersync - browser-sync.js - - -global_files: - commands/web/browsersync post_install_actions: - +- | + #ddev-nodisplay + #ddev-description:Check for global 'browser-sync.js' + if ( test -f "$HOME/.ddev/commands/web/browsersync" ) ; then + echo "Note: '~/.ddev/commands/web/browsersync' is no longer required and can be safely removed." && exit 0 + fi