Skip to content

Commit

Permalink
Feature/bash shebang (#31)
Browse files Browse the repository at this point in the history
* use recommended shebang

* easy copy of code snippets

* updated alpine version
  • Loading branch information
unfor19 authored Aug 21, 2021
1 parent 50ec65c commit 5a1ad5f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.12
FROM alpine:3.14
RUN apk add --no-cache util-linux bash
WORKDIR /code
COPY . .
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ A utility for creating a Bash CLI application.
### macOS

```bash
$ brew install util-linux
brew install util-linux
```

### Ubuntu (Debian)

```bash
$ sudo apt-get -y update && sudo apt-get install -y bsdmainutils
sudo apt-get -y update && sudo apt-get install -y bsdmainutils
```

### Alpine

```bash
$ apk add --no-cache util-linux bash
apk add --no-cache util-linux bash
```

### CentOS

```bash
$ yum update -y && yum install -y util-linux bash
yum update -y && yum install -y util-linux bash
```

### Windows
Expand All @@ -80,11 +80,11 @@ Works in Windows-Subsystem-Linux ([WSL](https://docs.microsoft.com/en-us/windows
Make sure you use [dos2unix](https://linux.die.net/man/1/dos2unix) on all files, see another example [here](https://github.com/unfor19/bargs/blob/master/.github/workflows/testing.yml)

```powershell
PS> choco install dos2unix
...
PS> dos2unix bargs.sh bargs_vars example.sh tests.sh
...
PS> wsl -u root -d Ubuntu-18.04 -- source example.sh
choco install dos2unix
# ...
dos2unix bargs.sh bargs_vars example.sh tests.sh
# ...
wsl -u root -d Ubuntu-18.04 -- source example.sh
```

</details>
Expand Down Expand Up @@ -469,12 +469,12 @@ You can use [Docker](https://www.docker.com/why-docker) to package your Bash scr
1. Build the image, see [Dockerfile.example](https://github.com/unfor19/bargs/blob/master/Dockerfile.example), tag it `bargs:example`
```bash
$ docker build -f Dockerfile.example -t bargs:example .
docker build -f Dockerfile.example -t bargs:example .
```

1. Run a container that is based on the image above
```bash
$ docker run --rm -it bargs:example -a 23 -g male
docker run --rm -it bargs:example -a 23 -g male
```

## Use this repository as a template
Expand All @@ -492,7 +492,7 @@ Pull requests are welcome! These are the steps:
1. Add the code of your new feature
1. Run tests on your code, feel free to add more tests
```bash
$ bash tests.sh
bash tests.sh
... # All good? Move on to the next step
```
1. Commit your remarkable changes (`git commit -am 'Added new feature'`)
Expand Down
2 changes: 1 addition & 1 deletion bargs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
Expand Down

0 comments on commit 5a1ad5f

Please sign in to comment.