From 0b0bd089c4abacd5812f2afdf5c46c883350a3c0 Mon Sep 17 00:00:00 2001 From: commit111 Date: Fri, 15 Nov 2024 11:16:31 -0800 Subject: [PATCH 1/4] fix installation to work with bash and all versions of shell --- .github/workflows/install.yml | 4 ++-- README.md | 2 +- src/bin/install | 2 +- src/pkg/cli/upgrade.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 1b041e589..c866bfd80 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Install defang (latest) - run: . <(curl -Ls https://s.defang.io/install) + run: curl -Ls https://s.defang.io/install | bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # avoid rate limiting @@ -24,7 +24,7 @@ jobs: run: defang --version - name: Install defang (specific version) - run: . <(curl -Ls https://s.defang.io/install) + run: curl -Ls https://s.defang.io/install | bash env: DEFANG_INSTALL_VERSION: v0.5.36 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # alt name diff --git a/README.md b/README.md index 4e6182ff7..7600e6398 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Install the Defang CLI from one of the following sources: * Using a shell script: ``` - . <(curl -Ls https://s.defang.io/install) + curl -Ls https://s.defang.io/install | bash ``` * Using [Go](https://go.dev): diff --git a/src/bin/install b/src/bin/install index 3a1b6dfa0..96087158e 100644 --- a/src/bin/install +++ b/src/bin/install @@ -3,7 +3,7 @@ # This script installs the latest release of defang from GitHub. It is designed # # to be run like this: # # # -# . <(curl -Ls https://s.defang.io/install) # +# curl -Ls https://s.defang.io/install | bash # # # # This allows us to do some interactive stuff where we can prompt the user for input. # # # diff --git a/src/pkg/cli/upgrade.go b/src/pkg/cli/upgrade.go index 9c1196a5f..4cacb6f2e 100644 --- a/src/pkg/cli/upgrade.go +++ b/src/pkg/cli/upgrade.go @@ -49,7 +49,7 @@ func Upgrade(ctx context.Context) error { } // Default to the shell script - printInstructions(`. <(curl -Ls https://s.defang.io/install)`) + printInstructions(`curl -Ls https://s.defang.io/install | bash`) return nil } From dc55839b3d63de05187cb46c2ca370b9a5539399 Mon Sep 17 00:00:00 2001 From: commit111 Date: Fri, 15 Nov 2024 14:31:50 -0800 Subject: [PATCH 2/4] used eval instead of piping to bash --- .github/workflows/install.yml | 4 ++-- README.md | 2 +- src/bin/install | 2 +- src/pkg/cli/upgrade.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index c866bfd80..457f7dfcc 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Install defang (latest) - run: curl -Ls https://s.defang.io/install | bash + run: eval "$( curl -Ls https://s.defang.io/install)" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # avoid rate limiting @@ -24,7 +24,7 @@ jobs: run: defang --version - name: Install defang (specific version) - run: curl -Ls https://s.defang.io/install | bash + run: eval "$( curl -Ls https://s.defang.io/install)" env: DEFANG_INSTALL_VERSION: v0.5.36 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # alt name diff --git a/README.md b/README.md index 7600e6398..6b5b81d9a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Install the Defang CLI from one of the following sources: * Using a shell script: ``` - curl -Ls https://s.defang.io/install | bash + eval "$( curl -Ls https://s.defang.io/install)" ``` * Using [Go](https://go.dev): diff --git a/src/bin/install b/src/bin/install index 96087158e..174650c23 100644 --- a/src/bin/install +++ b/src/bin/install @@ -3,7 +3,7 @@ # This script installs the latest release of defang from GitHub. It is designed # # to be run like this: # # # -# curl -Ls https://s.defang.io/install | bash # +# eval "$( curl -Ls https://s.defang.io/install)" # # # # This allows us to do some interactive stuff where we can prompt the user for input. # # # diff --git a/src/pkg/cli/upgrade.go b/src/pkg/cli/upgrade.go index 4cacb6f2e..080838c64 100644 --- a/src/pkg/cli/upgrade.go +++ b/src/pkg/cli/upgrade.go @@ -49,7 +49,7 @@ func Upgrade(ctx context.Context) error { } // Default to the shell script - printInstructions(`curl -Ls https://s.defang.io/install | bash`) + printInstructions(`eval "$( curl -Ls https://s.defang.io/install)"`) return nil } From 5e2a84df191a4537359d05d286ffcdb6b2ebc61a Mon Sep 17 00:00:00 2001 From: commit111 Date: Sun, 17 Nov 2024 16:05:00 -0800 Subject: [PATCH 3/4] fix spacing --- .github/workflows/install.yml | 4 ++-- README.md | 2 +- src/bin/install | 2 +- src/pkg/cli/upgrade.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 457f7dfcc..29c2d9e41 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Install defang (latest) - run: eval "$( curl -Ls https://s.defang.io/install)" + run: eval "$(curl -Ls https://s.defang.io/install)" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # avoid rate limiting @@ -24,7 +24,7 @@ jobs: run: defang --version - name: Install defang (specific version) - run: eval "$( curl -Ls https://s.defang.io/install)" + run: eval "$(curl -Ls https://s.defang.io/install)" env: DEFANG_INSTALL_VERSION: v0.5.36 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # alt name diff --git a/README.md b/README.md index 6b5b81d9a..ea4e6dd99 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Install the Defang CLI from one of the following sources: * Using a shell script: ``` - eval "$( curl -Ls https://s.defang.io/install)" + eval "$(curl -Ls https://s.defang.io/install)" ``` * Using [Go](https://go.dev): diff --git a/src/bin/install b/src/bin/install index 174650c23..058c54ddc 100644 --- a/src/bin/install +++ b/src/bin/install @@ -3,7 +3,7 @@ # This script installs the latest release of defang from GitHub. It is designed # # to be run like this: # # # -# eval "$( curl -Ls https://s.defang.io/install)" # +# eval "$(curl -Ls https://s.defang.io/install)" # # # # This allows us to do some interactive stuff where we can prompt the user for input. # # # diff --git a/src/pkg/cli/upgrade.go b/src/pkg/cli/upgrade.go index 080838c64..7f9378b5a 100644 --- a/src/pkg/cli/upgrade.go +++ b/src/pkg/cli/upgrade.go @@ -49,7 +49,7 @@ func Upgrade(ctx context.Context) error { } // Default to the shell script - printInstructions(`eval "$( curl -Ls https://s.defang.io/install)"`) + printInstructions(`eval "$(curl -Ls https://s.defang.io/install)"`) return nil } From 17b8a1b4608206a0023e6bd05826f8e5d6401ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lio=E6=9D=8E=E6=AD=90?= Date: Mon, 18 Nov 2024 17:46:53 -0800 Subject: [PATCH 4/4] Update src/bin/install --- src/bin/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/install b/src/bin/install index 058c54ddc..17a80f715 100644 --- a/src/bin/install +++ b/src/bin/install @@ -3,7 +3,7 @@ # This script installs the latest release of defang from GitHub. It is designed # # to be run like this: # # # -# eval "$(curl -Ls https://s.defang.io/install)" # +# eval "$(curl -Ls https://s.defang.io/install)" # # # # This allows us to do some interactive stuff where we can prompt the user for input. # # #