Skip to content

Commit

Permalink
use -sfS for looks
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Jun 14, 2024
1 parent 40a58d1 commit d20a5c1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
node-version: 16.x
- name: install shellspec
run: curl -fsSL https://git.io/shellspec | sh -s 0.28.1 --yes
run: curl -sfSL https://git.io/shellspec | sh -s 0.28.1 --yes
- run: which shellspec
- run: npm install
- run: npm run standard
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![curl -fsS https://dotenvx.sh/ | sh](https://dotenvx.com/binary-banner.png)
![curl -sfS https://dotenvx.sh/ | sh](https://dotenvx.com/binary-banner.png)
```sh
curl -fsS https://dotenvx.sh/install.sh | sh
curl -sfS https://dotenvx.sh/install.sh | sh
```
> [`dotenvx`](https://github.com/dotenvx/dotenvx#readme) binary installer
>
Expand Down
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ app.get('/installer.sh', (req, res) => {
})

app.get('/install.sh', (req, res) => {
// /install.sh?version=X.X.X
// /install.sh?version=X.X.X&directory=.
const version = req.query.version
const directory = req.query.directory

// install.sh
const scriptPath = path.join(__dirname, 'install.sh')
Expand All @@ -131,10 +132,16 @@ app.get('/install.sh', (req, res) => {
return
}

// curl -sfS https://dotenvx.sh/install.sh?version=1.0.0
if (version) {
data = data.replace(/VERSION="[^"]*"/, `VERSION="${version}"`)
}

// curl -sfS https://dotenvx.sh/install.sh?directory=.
if (directory) {
data = data.replace(/DIRECTORY="[^"]*"/, `DIRECTORY="${directory}"`)
}

res.type('text/plain')
res.send(data)
})
Expand Down
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ INSTALL_SCRIPT_URL="https://dotenvx.sh/install.sh"
# | ## Install |
# | |
# | ```sh |
# | curl -fsS https://dotenvx.sh/install.sh | sh |
# | curl -sfS https://dotenvx.sh/install.sh | sh |
# | ``` |
# | |
# | or self-execute this file: |
# | |
# | ```sh |
# | curl -fsS https://dotenvx.sh/install.sh > install.sh |
# | curl -sfS https://dotenvx.sh/install.sh > install.sh |
# | chmod +x install.sh |
# | ./install.sh |
# | ``` |
Expand All @@ -40,10 +40,10 @@ INSTALL_SCRIPT_URL="https://dotenvx.sh/install.sh"
# | |
# | ```sh |
# | # curl examples |
# | curl -fsS https://dotenvx.sh/install.sh | sudo sh |
# | curl -fsS https://dotenvx.sh/install.sh | sh -s -- --directory=. |
# | curl -fsS https://dotenvx.sh/install.sh | sh -s -- --version=0.44.0 |
# | curl -fsS https://dotenvx.sh/install.sh | sh -s -- --directory=/custom/path --version=0.44.0 |
# | curl -sfS https://dotenvx.sh/install.sh | sudo sh |
# | curl -sfS https://dotenvx.sh/install.sh | sh -s -- --directory=. |
# | curl -sfS https://dotenvx.sh/install.sh | sh -s -- --version=0.44.0 |
# | curl -sfS https://dotenvx.sh/install.sh | sh -s -- --directory=/custom/path --version=0.44.0 |
# | |
# | # self-executing examples |
# | ./install.sh --directory=. |
Expand Down Expand Up @@ -291,7 +291,7 @@ warn_of_any_conflict() {
# help text -----------------------------
help_sudo_install_command() {
if is_piped; then
echo "curl -fsS $INSTALL_SCRIPT_URL | sudo $0"
echo "curl -sfS $INSTALL_SCRIPT_URL | sudo $0"
else
echo "sudo $0"
fi
Expand All @@ -301,7 +301,7 @@ help_sudo_install_command() {

help_customize_directory_command() {
if is_piped; then
echo "curl -fsS $INSTALL_SCRIPT_URL | $0 -s -- --directory=."
echo "curl -sfS $INSTALL_SCRIPT_URL | $0 -s -- --directory=."
else
echo "$0 --directory=."
fi
Expand Down
12 changes: 6 additions & 6 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ set -e
# | ## Install |
# | |
# | ```sh |
# | curl -fsS https://dotenvx.sh/install.sh | sh |
# | curl -sfS https://dotenvx.sh/install.sh | sh |
# | ``` |
# | |
# | or self-execute this file: |
# | |
# | ```sh |
# | curl -fsS https://dotenvx.sh/install.sh > install.sh |
# | curl -sfS https://dotenvx.sh/install.sh > install.sh |
# | chmod +x install.sh |
# | ./install.sh |
# | ``` |
Expand All @@ -36,10 +36,10 @@ set -e
# | |
# | ```sh |
# | # curl examples |
# | curl -fsS https://dotenvx.sh/install.sh | sudo sh |
# | curl -fsS https://dotenvx.sh/install.sh | sh -s -- --directory=. |
# | curl -fsS https://dotenvx.sh/install.sh | sh -s -- --version=0.44.0 |
# | curl -fsS https://dotenvx.sh/install.sh | sh -s -- --directory=/custom/path --version=0.44.0 |
# | curl -sfS https://dotenvx.sh/install.sh | sudo sh |
# | curl -sfS https://dotenvx.sh/install.sh | sh -s -- --directory=. |
# | curl -sfS https://dotenvx.sh/install.sh | sh -s -- --version=0.44.0 |
# | curl -sfS https://dotenvx.sh/install.sh | sh -s -- --directory=/custom/path --version=0.44.0 |
# | |
# | # self-executing examples |
# | ./install.sh --directory=. |
Expand Down
4 changes: 2 additions & 2 deletions spec/install_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Describe 'install.sh'
It "returns with curl example"
When call help_sudo_install_command
The status should equal 0
The output should equal "curl -fsS https://dotenvx.sh/install.sh | sudo $0"
The output should equal "curl -sfS https://dotenvx.sh/install.sh | sudo $0"
End
End
End
Expand All @@ -104,7 +104,7 @@ Describe 'install.sh'
It "returns with curl example"
When call help_customize_directory_command
The status should equal 0
The output should equal "curl -fsS https://dotenvx.sh/install.sh | $0 -s -- --directory=."
The output should equal "curl -sfS https://dotenvx.sh/install.sh | $0 -s -- --directory=."
End
End
End
Expand Down

0 comments on commit d20a5c1

Please sign in to comment.