format markdown
[webi-installers/.git] / webi / webi.bash
1 #!/bin/bash
2
3 # title: Webi
4 # homepage: https://webinstall.dev
5 # tagline: webinstall.dev for the CLI
6 # description: |
7 #   for the people like us that are too lazy even to run <kbd>curl&nbsp;https://webinstall.dev/PACKAGE_NAME&nbsp;|&nbsp;bash</kbd>
8 # examples: |
9 #   ```bash
10 #   webi node
11 #   ```
12 #   <br/>
13 #
14 #   ```bash
15 #   webi golang
16 #   ```
17 #   <br/>
18 #
19 #   ```bash
20 #   webi rustlang
21 #   ```
22
23 # TODO webi package@semver#channel
24
25 cat << EOF > ~/.local/bin/webi
26 set -e
27 set -u
28
29 my_package=\${1:-}
30 if [ -z "\$my_package" ]; then
31         echo "Usage: webi <package>"
32         echo "Example: webi node"
33         exit 1
34 fi
35
36 curl -fsSL "https://webinstall.dev/\$my_package" | bash
37 EOF
38 chmod a+x ~/.local/bin/webi