From b8673d1ecdab643d1c5114d24072a4424cab8e3f Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Fri, 23 Feb 2024 16:32:41 -0300 Subject: [PATCH] Fix man page installations --- roles/bash/files/.bashrc | 1 + roles/bash/tasks/main.yml | 6 ++++ .../files/{terminal_z.sh => includes.sh} | 2 +- roles/terminal/files/{ => z}/z.1 | 0 roles/terminal/files/{ => z}/z.sh | 0 roles/terminal/tasks/main.yml | 33 +++++++++---------- 6 files changed, 23 insertions(+), 19 deletions(-) rename roles/terminal/files/{terminal_z.sh => includes.sh} (69%) rename roles/terminal/files/{ => z}/z.1 (100%) rename roles/terminal/files/{ => z}/z.sh (100%) diff --git a/roles/bash/files/.bashrc b/roles/bash/files/.bashrc index f23051e..366eff4 100644 --- a/roles/bash/files/.bashrc +++ b/roles/bash/files/.bashrc @@ -54,6 +54,7 @@ unset color_prompt LC_ALL="en_US.UTF-8" PATH=~/.bin/:${PATH} +MANPATH=~/.man/:${MANPATH} # no zsh here! export BASH_SILENCE_DEPRECATION_WARNING=1 diff --git a/roles/bash/tasks/main.yml b/roles/bash/tasks/main.yml index be615c3..bf24508 100644 --- a/roles/bash/tasks/main.yml +++ b/roles/bash/tasks/main.yml @@ -64,3 +64,9 @@ - {src: files/bin/clipboard.sh, dest: "{{ home_folder }}/.bin/clipboard"} - {src: files/bin/colors.sh, dest: "{{ home_folder }}/.bin/colors"} - {src: files/bin/passphrase.sh, dest: "{{ home_folder }}/.bin/passphrase"} + +- name: Create ~/.man/ folder + ansible.builtin.file: + path: "{{ home_folder }}/.man/man1/" + state: directory + mode: '755' diff --git a/roles/terminal/files/terminal_z.sh b/roles/terminal/files/includes.sh similarity index 69% rename from roles/terminal/files/terminal_z.sh rename to roles/terminal/files/includes.sh index e764b71..034861d 100644 --- a/roles/terminal/files/terminal_z.sh +++ b/roles/terminal/files/includes.sh @@ -1,3 +1,3 @@ # shellcheck disable=SC2148 # shellcheck disable=SC1090 -. ~/.local/share/z/z.sh +. ~/.local/shared/z/z.sh diff --git a/roles/terminal/files/z.1 b/roles/terminal/files/z/z.1 similarity index 100% rename from roles/terminal/files/z.1 rename to roles/terminal/files/z/z.1 diff --git a/roles/terminal/files/z.sh b/roles/terminal/files/z/z.sh similarity index 100% rename from roles/terminal/files/z.sh rename to roles/terminal/files/z/z.sh diff --git a/roles/terminal/tasks/main.yml b/roles/terminal/tasks/main.yml index 6561a8a..95d3f8b 100644 --- a/roles/terminal/tasks/main.yml +++ b/roles/terminal/tasks/main.yml @@ -29,13 +29,6 @@ state: present become: "{{ become_root }}" -- name: Add bash functions to ~/.bashrc - ansible.builtin.blockinfile: - path: "{{ home_folder }}/.bashrc" - marker: "# {mark} terminal/files/functions.sh" - block: "{{ lookup('file', 'files/functions.sh') }}" - - - name: Create ~/.local/share/z/ folder ansible.builtin.file: path: "{{ home_folder }}/.local/share/z/" @@ -44,20 +37,24 @@ - name: Copy z.sh to shared folder ansible.builtin.copy: - src: files/z.sh + src: files/z/z.sh dest: "{{ home_folder }}/.local/shared/z/" mode: preserve -# - name: Install z man page -# ansible.builtin.copy: -# src: files/z.1 -# dest: "/usr/share/man/man1/" -# mode: preserve -# become: "{{ become_root }}" +- name: Install z man page + ansible.builtin.copy: + src: files/z/z.1 + dest: "{{ home_folder }}/.man/man1" + mode: preserve + +- name: Add terminal functions to ~/.bashrc + ansible.builtin.blockinfile: + path: "{{ home_folder }}/.bashrc" + marker: "# {mark} terminal/files/functions.sh" + block: "{{ lookup('file', 'files/functions.sh') }}" -- name: Add z - when: ansible_distribution == 'MacOSX' +- name: Add terminal includes to ~/.bashrc ansible.builtin.blockinfile: path: "{{ home_folder }}/.bashrc" - marker: "# {mark} terminal_z.sh" - block: "{{ lookup('file', 'files/terminal_z.sh') }}" + marker: "# {mark} terminal/files/includes.sh" + block: "{{ lookup('file', 'files/includes.sh') }}"