Skip to content

Commit 832d320

Browse files
committed
refactor node and postgres add path tasks, add .prettierrc
1 parent d95d35d commit 832d320

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tabWidth": 2,
3+
"prettier.singleQuote": true
4+
}

roles/nodejs/tasks/main.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
# tasks file for nodejs
33
- name: clone nvm into ~/.nvm
4-
git:
4+
git:
55
repo: https://github.com/nvm-sh/nvm.git
6-
dest: ~/.nvm
6+
dest: ~/.nvm
77
- name: Add NVM initialization to startup files
88
blockinfile:
99
marker: "### {mark} INTIALIZE NVM"
@@ -18,9 +18,9 @@
1818
with_items:
1919
- "~/.zshrc"
2020
- name: Install Node {{ wanted_node_version }}
21-
command:
21+
command:
2222
cmd: bash -c '. ~/.nvm/nvm.sh; nvm install {{ wanted_node_version }};'
23-
creates:
23+
creates:
2424
- ~/.nvm/versions/node/*{{ wanted_node_version }}*/bin/node
2525
- name: Set Node {{ wanted_node_version }} to be the default
2626
command:
@@ -36,15 +36,16 @@
3636
command:
3737
cmd: bash -c '. ~/.nvm/nvm.sh; nvm use --silent default; which npm'
3838
register: npm_path
39-
- name: Add node and npm to path
40-
shell: export PATH="$HOME/.nvm/versions/node/v18.14.0/bin:$PATH"
41-
- name: Add the path to .zshrc
39+
# - name: Add node and npm to path
40+
# shell: export PATH="$HOME/.nvm/versions/node/v18.14.0/bin:$PATH"
41+
- name: Add the path to .zshrc
4242
lineinfile:
43+
marker: "### {mark} Add Node directory to the PATH"
4344
dest: ~/.zshrc
44-
line: export PATH="$HOME/.nvm/versions/node/v18.14.0/bin:$PATH"
45+
line: export PATH="$HOME/.nvm/versions/node:$PATH"
4546
- name: Print Node version
46-
debug:
47+
debug:
4748
msg: "{{ node_version.stdout }}"
4849
- name: Print Node version
49-
debug:
50-
msg: "{{ npm_path.stdout }}"
50+
debug:
51+
msg: "{{ npm_path.stdout }}"

roles/postgresql/tasks/postgres-macos.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
update_homebrew: yes
44
name: postgresql@15
55
state: present
6-
- name: Add PATH for postgresql@15
7-
command: echo 'export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
6+
# - name: Add PATH for postgresql@15
7+
# command: echo 'export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
8+
- name: Add postgres directory to the PATH
9+
lineinfile:
10+
marker: "### {mark} Add postgresql@15 directory to the PATH"
11+
dest: ~/.zshrc
12+
line: export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
813
- name: Start postgresl
914
command: brew services start postgresql@15
1015
- name: Check for default database

0 commit comments

Comments
 (0)