Skip to content

Commit

Permalink
chore(ansible:tasks): add condition when setting default SHELL to zsh
Browse files Browse the repository at this point in the history
  ## what
  - add condition when setting default SHELL to zsh

  ## how

  ## why
  - should check if the current shell is `ZSH`
  - should check if the env `USER` is set
    - when test running the workflow using `act` on a local machine,
      `USER` env doesn't exist

  ## where
  - ./tasks/zsh.yaml

  ## usage

  ## issue or pull request
  • Loading branch information
Clumsy-Coder committed Jan 31, 2024
1 parent 2847003 commit b022341
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/zsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
shell:
cmd: chsh -s /bin/zsh {{ ansible_env.USER }}
become: true
when:
- ansible_env.SHELL != '/bin/zsh'
- lookup('ansible.builtin.env', 'USER')
tags:
- zsh
- terminal

0 comments on commit b022341

Please sign in to comment.