diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d61a3a..f09f3e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/README.md b/README.md index 7772ed1..09f84ae 100644 --- a/README.md +++ b/README.md @@ -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 > diff --git a/index.js b/index.js index 4349cb2..64792e6 100644 --- a/index.js +++ b/index.js @@ -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') @@ -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) }) diff --git a/install.sh b/install.sh index f5f2c15..4d54459 100755 --- a/install.sh +++ b/install.sh @@ -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 | # | ``` | @@ -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=. | @@ -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 @@ -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 diff --git a/installer.sh b/installer.sh index 0422174..04a8d7f 100644 --- a/installer.sh +++ b/installer.sh @@ -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 | # | ``` | @@ -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=. | diff --git a/spec/install_spec.sh b/spec/install_spec.sh index dc9e13d..6756674 100644 --- a/spec/install_spec.sh +++ b/spec/install_spec.sh @@ -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 @@ -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