Skip to content

Commit 637516d

Browse files
Release 1.1 (#11)
* cask is already included with homebrew, and pip3 required to run on my machine (#9) * Macos catalina (#10) * add alias for git log --graph * change glog format * add more mac os catalina fixes * update .profile * remove hub alias, add pyenv eval to profile instead of zshrc Co-authored-by: Michael Meadows <michaelmeadows@gmail.com>
1 parent 9f9d612 commit 637516d

File tree

7 files changed

+34
-22
lines changed

7 files changed

+34
-22
lines changed

roles/bootstrap/tasks/darwin.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1+
- name: Install Xcode Command Line Tools Catalina +
2+
block:
3+
- stat:
4+
path: /Library/Developer/CommandLineTools
5+
register: xcode
6+
7+
- name: Install Xcode Command Line Tools w/ UI
8+
shell: xcode-select --install
9+
when: not xcode.stat.exists
10+
11+
when: ansible_facts['distribution_version'] is version('10.15.0', '>=')
12+
113
- name: touch installondemand file
214
file:
315
state: touch
416
path: /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
517

6-
- name: Install Xcode Command Line Tools
18+
- name: Install Xcode CLI Tools
719
shell: |
820
PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n')
921
softwareupdate -i "$PROD"
@@ -13,10 +25,10 @@
1325
state: absent
1426
path: /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
1527

16-
- name: alias xcrun git to git in profile
28+
- name: alias xcrun git to git in zshrc
1729
copy:
1830
dest: "/Users/{{ ansible_user_id }}/.profile"
19-
content: aliast git='xcrun git'
31+
content: alias git='xcrun git'
2032

2133
- name: ensure homebrew dir exists
2234
file:
@@ -32,17 +44,14 @@
3244

3345
- name: add homebrew binaries to path
3446
copy:
35-
dest: "/Users/{{ ansible_user_id }}/.profile"
47+
dest: "/Users/{{ ansible_user }}/.profile"
3648
content: PATH=$PATH:/usr/local/homebrew/bin
3749

3850
- name: update homebrew
3951
homebrew:
4052
update_homebrew: yes
4153
upgrade_all: yes
4254

43-
- name: enable homebrew cask
44-
shell: brew tap caskroom/cask
45-
4655
- name: install jq
4756
homebrew:
4857
name: jq

roles/git/tasks/darwin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: install hub for git
2+
- name: install cli for github
33
homebrew:
4-
name: hub
4+
name: github/gh/gh
55
state: latest

roles/git/tasks/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
state: latest
66
become: true
77

8-
- name: Install hub for git
8+
- name: Install cli for github
99
package:
1010
name: hub
1111
state: latest

roles/git/tasks/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,3 @@
1515
get_url:
1616
url: https://gist.githubusercontent.com/octocat/9257657/raw/3f9569e65df83a7b328b39a091f0ce9c6efc6429/.gitignore
1717
dest: ~/.gitignore
18-
19-
- name: Alias hub to git
20-
lineinfile:
21-
dest: ~/.profile
22-
line: 'eval "$(hub alias -s)"'

roles/git/templates/gitconfig.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
ci = commit
1111
co = checkout
1212
slog = log --pretty=format:'%C(white)[%C(yellow)%h%C(white)] %C(blue)(%ad) %C(white)%s %C(green)%an' --date=local
13+
glog = log --graph --pretty=oneline --abbrev-commit
1314
st = status -s
1415
blame = blame -w
1516
wtf = blame -w

roles/python/tasks/darwin.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@
1010
line: "export PATH=${PATH}:$(pyenv root)/shims"
1111
regexp: "^export PATH=${PATH}"
1212

13+
- name: Add pyenv to .profile
14+
lineinfile:
15+
dest: "/Users/{{ ansible_user }}/.profile"
16+
line: 'eval "$(pyenv init -)"'
17+
1318
# NOTE: CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.7.3
1419
# If you're getting compilation errors caused by xcode cli tools

roles/zsh/tasks/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
lineinfile:
1919
dest: "~/.zshrc"
2020
insertafter: BOF
21-
line: 'export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
21+
line: 'export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
22+
state: present
23+
24+
- name: Shim profile into zshrc
25+
lineinfile:
26+
dest: "~/.zshrc"
27+
insertafter: BOF
28+
line: 'source ~/.profile'
2229
state: present
2330

2431
- name: Set zsh theme
@@ -42,7 +49,7 @@
4249
become: true
4350

4451
- name: Install powerline
45-
shell: pip install --user git+git://github.com/powerline/powerline
52+
shell: pip install --user git+git://github.com/powerline/powerline
4653
become: true
4754

4855
- name: reload zshrc
@@ -51,11 +58,6 @@
5158
executable: /usr/bin/zsh
5259
when: ansible_system == "Linux"
5360

54-
- name: ensure ~/.profile is sourced in zshrc
55-
lineinfile:
56-
path: "/Users/{{ ansible_user_id }}/.zshrc"
57-
line: 'source ~/.profile'
58-
5961
- name: reload zshrc
6062
shell: "source ~/.zshrc"
6163
args:

0 commit comments

Comments
 (0)