Skip to content

Commit

Permalink
Fix darwin (#24)
Browse files Browse the repository at this point in the history
* Fix whitespace issue

* Make toolchain detection more generic

* Update action badge

* Fix macOS/Darwin
  • Loading branch information
hurricanehrndz authored Nov 18, 2023
1 parent e7417bc commit b548e1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ Install rust and user defined cargo crates via rustup using `https://sh.rustup.r
[ansible-badge]: https://img.shields.io/ansible/role/d/44247?style=for-the-badge
[ansible-link]: https://galaxy.ansible.com/hurricanehrndz/rustup
[action-badge]: https://img.shields.io/github/workflow/status/hurricanehrndz/ansible-rustup/CI?style=for-the-badge
[action-badge]: https://github.com/hurricanehrndz/ansible-rustup/actions/workflows/main.yml/badge.svg
[action-link]: https://github.com/hurricanehrndz/ansible-rustup/actions?query=workflow%3ACI
7 changes: 4 additions & 3 deletions tasks/set-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

- name: Get active toolchain version
ansible.builtin.shell:
cmd: "rustup default | sed 's/armv7l/armv7/g' | grep -Po '^.*?(?=-{{ ansible_architecture }})'"
cmd: |
rustup default | sed -n 's#\([^-]\+\).*#\1#p'
register: rustup_default_output
environment:
RUSTUP_HOME: "{{ rustup_user_home }}/{{ rustup_home_suffix }}"
Expand All @@ -12,8 +13,8 @@
ignore_errors: true

- name: Get currently active toolchain if installed and set
when:
- not rustup_default_output.failed
when:
- not rustup_default_output.failed
block:
- name: Print current / active toolchain version
ansible.builtin.debug:
Expand Down
File renamed without changes.

0 comments on commit b548e1f

Please sign in to comment.