Skip to content

Commit

Permalink
docs: Add alpine linux install
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Dec 29, 2023
1 parent 8c18cf4 commit 87e0a97
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [Fedora / CentOS](#fedora--centos)
- [Nix](#nix)
- [Arch Linux](#arch-linux)
- [Alpine Linux](#alpine-linux)
- [Windows](#windows)
- [Cargo](#cargo)
- [Docker](#docker)
Expand Down Expand Up @@ -84,6 +85,18 @@ nix-env -f '<nixpkgs>' -iA nur.repos.dustinblackman.oatmeal
yay -S oatmeal-bin
```

### Alpine Linux

<!-- alpine-install start -->

```sh
arch=$(uname -a | grep -q aarch64 && echo 'arm64' || echo 'amd64')
curl -L -o oatmeal.apk "https://github.com/dustinblackman/oatmeal/releases/download/v0.12.1/oatmeal_0.12.1_linux_${arch}.apk"
apk add --allow-untrusted ./oatmeal.apk
```

<!-- alpine-install end -->

### Windows

**Chocolatey**
Expand Down
19 changes: 17 additions & 2 deletions tools/xtask/src/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn update() {
.to_string();
let version_res = cmd(vec!["--version"]);

let version = version_res.split(' ').collect::<Vec<&str>>()[1];
let version = version_res.split(' ').collect::<Vec<&str>>()[1].trim();

let mut readme = fs::read_to_string("./README.md").unwrap();

Expand Down Expand Up @@ -64,10 +64,25 @@ pub fn update() {
readme.replace_range(
start_choco..end_choco,
&format!(
"<!-- choco-install start -->\n```sh\nchoco install oatmeal --version={version}```\n"
"<!-- choco-install start -->\n```sh\nchoco install oatmeal --version={version}\n```\n"
),
);

let start_alpine = readme.find("<!-- alpine-install start -->").unwrap();
let end_alpine = readme.find("<!-- alpine-install end -->").unwrap();
readme.replace_range(
start_alpine..end_alpine,
&format!(r#"
<!-- alpine-install start -->
```sh
arch=$(uname -a | grep -q aarch64 && echo 'arm64' || echo 'amd64')
curl -L -o oatmeal.apk "https://github.com/dustinblackman/oatmeal/releases/download/v{version}/oatmeal_{version}_linux_${{arch}}.apk"
apk add --allow-untrusted ./oatmeal.apk
```
"#)
);

readme = readme.replace(&env::var("HOME").unwrap(), "~");

let mut f = fs::File::create("./README.md").unwrap();
Expand Down

0 comments on commit 87e0a97

Please sign in to comment.