Skip to content

Commit

Permalink
Merge pull request #176 from yassinebenaid/update-docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
yassinebenaid authored Feb 6, 2025
2 parents 916c8bb + 91c9992 commit 19d637c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 24 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ makes you feel happy when writing shell scripts. a feeling that shells usually d

## Installation

We have bash script that installs `bunster` and adds it to your `$PATH`.

```shell
curl -f https://bunster.netlify.app/install.sh | bash
```


The script will install bunster at `~/.local/bin/bunster` on linux. And `~/bin/bunster` on mac. If you want to install the binary system wide and make it accessible by all users.

```shell
curl -f https://bunster.netlify.app/install.sh | GLOBAL=1 bash
```


> [!WARNING]
> Do not trust scripts downloaded from the internet. A quick look at the code before running it won't hurt.
Checkout the [documentation](https://bunster.netlify.app/installation) for different ways of installation.

## FAQ
Expand Down Expand Up @@ -78,6 +95,10 @@ Once we reach the stable release `v1.0.0`, you must expect your bash scripts to

Adding support for additional shells is not planned until our first stable release `v1`. All regarding contributions will remain open until then.

## Developers Guidline

If you are interested in this project and want to know more about it's underlying implementation. Or if you want to contribute back but you don't know where to start. [We have brief article](https://bunster.netlify.app/developers) that explains everything you need to get your hands dirty. Things like the project structure, packages and their concerns, how each component work and interact with other components, how to add new features, how to improve existing features, testing and anything else in this regard.

## Contributing

Thank you for considering contributing to the Bunster project! The contribution guide can be found in the [documentation](https://bunster.netlify.app/contributing).
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default defineConfig({
{ text: "Supported Features", link: "/supported-features" },
{ text: "Usage", link: "/usage" },
{ text: "Contributing", link: "/contributing" },
{ text: "Developers Guideline", link: "/developers" },
],
},
],
Expand Down
4 changes: 4 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Improving The Documentation](#improving-the-documentation)
- [Developers Guideline](#developers-guideline)
- [Styleguides](#styleguides)
- [Commit Messages](#commit-messages)
- [Join The Project Team](#join-the-project-team)
Expand Down Expand Up @@ -101,3 +102,6 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/yassin
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
- **Explain why this enhancement would be useful** to most bunster users. You may also want to point out the other shells that solved it better and which could serve as inspiration.

## Developers Guideline
If you want to know more about the codebase. We have a [dedicated section](https://bunster.netlify.app/developers) that explains pretty much everything you need to get your hands dirty. Dedicated only for you.
18 changes: 17 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,24 @@ If you only care about the generated Go code, and don't want **Bunster** to auto
That is totally fine and you can go for it.
:::

## Linux/Mac
We have bash script that installs `bunster` and adds it to your `$PATH`.

## Docker Image
```shell
curl -f https://bunster.netlify.app/install.sh | bash
```

The script will install bunster at `~/.local/bin/bunster` on linux. And `~/bin/bunster` on mac. If you want to install the binary system wide and make it accessible by all users.

```shell
curl -f https://bunster.netlify.app/install.sh | GLOBAL=1 bash
```

::: warning
Do not trust scripts downloaded from the interne. take a look at the code before running it.
:::

## Docker Image
The easiest way to get **Bunster** is through our official [Docker Image](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-an-image/).
It comes with everything needed. Including the **Bunster** compiler and [the Go toolchain](https://go.dev/dl).

Expand Down
14 changes: 1 addition & 13 deletions docs/public/install.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

global=0

for arg; do
if [ "$arg" = --global ];then
global=1
else
echo "unrecognized argument: $arg" >&2
exit 1
fi
done


set -e

log() {
Expand Down Expand Up @@ -120,7 +108,7 @@ main() {
log "Extracting archive"
tar -xzf "$ARCHIVE"

if [ $global = 1 ]; then
if [ $GLOBAL = 1 ]; then
log "Moving binary to /usr/local/bin"
sudo mv bunster /usr/local/bin/bunster
log "Installation complete!"
Expand Down
24 changes: 14 additions & 10 deletions docs/supported-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ as work-in-progress and as not-yet-supported.
- [`if` command](https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#index-if)
- [`while` & `until` loops](https://www.gnu.org/software/bash/manual/bash.html#index-until)
- [Shell Parameters](https://www.gnu.org/software/bash/manual/html_node/Shell-Parameters.html)
- Running commands in background
- [Functions](https://www.gnu.org/software/bash/manual/html_node/Shell-Functions.html)

## Code Example
```shell
Expand All @@ -28,6 +30,7 @@ cat 3<>io.txt 3>&-

# pipelines
cat file.json | jq '.filename' | grep "*hosts.txt"
! true

# conditional execution
command || command2 && command3
Expand Down Expand Up @@ -69,22 +72,23 @@ fi
while true; then
echo foo bar | cat

if true; then
break
else
continue
fi
true && break || continue
fi


# `until` command
until true; then
echo foo bar | cat

if true; then
break
else
continue
fi
true && break || continue
fi

# running commands in backgroud
command &

# functions
function foo() {
echo foobar
}

```

0 comments on commit 19d637c

Please sign in to comment.