Skip to content

Commit

Permalink
fix rust script
Browse files Browse the repository at this point in the history
  • Loading branch information
dombean committed Feb 13, 2025
1 parent bf7c2f6 commit 14bd1ba
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tasks/rust.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
- name: Install Rust and Cargo
shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
args:
creates: "{{ ansible_env.HOME }}/.cargo/bin/cargo"
become: true
environment:
HOME: "{{ ansible_env.HOME }}"

- name: Ensure Cargo binaries are in PATH
lineinfile:
path: /etc/profile.d/rust.sh
line: 'export PATH="$HOME/.cargo/bin:$PATH"'
create: yes
- name: Ensure Cargo is in PATH for current session
shell: . ~/.cargo/env
become: true

- name: Source rust environment (for current session)
shell: source ~/.cargo/env
become: true
when: ansible_env.HOME is defined
environment:
HOME: "{{ ansible_env.HOME }}"

Expand All @@ -25,5 +17,11 @@
become: true
environment:
HOME: "{{ ansible_env.HOME }}"
args:
creates: "{{ ansible_env.HOME }}/.cargo/bin/yazi-fm"
PATH: "{{ ansible_env.HOME }}/.cargo/bin:{{ ansible_env.PATH }}"

- name: Install fd-find
shell: cargo install fd-find
become: true
environment:
HOME: "{{ ansible_env.HOME }}"
PATH: "{{ ansible_env.HOME }}/.cargo/bin:{{ ansible_env.PATH }}"

0 comments on commit 14bd1ba

Please sign in to comment.