From 2f756cbbc66ec03fdc0ca9eaeafd2fb5620f431c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 11 Nov 2018 17:08:37 +0100 Subject: Add zeal docsets --- roles/contexts/fretlink/defaults/main.yml | 15 +++++++++++++++ roles/contexts/fretlink/tasks/main.yml | 19 +++++++++++++++++++ roles/init/templates/pam_environment.j2 | 3 +++ site.yml | 3 ++- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 roles/contexts/fretlink/defaults/main.yml diff --git a/roles/contexts/fretlink/defaults/main.yml b/roles/contexts/fretlink/defaults/main.yml new file mode 100644 index 0000000..ee9836f --- /dev/null +++ b/roles/contexts/fretlink/defaults/main.yml @@ -0,0 +1,15 @@ +--- +zeal_roles: + - Ansible + - Bash + - Docker + - Haskell + - MongoDB + - NodeJS + - PostgreSQL + - Puppet + - React + - Redis + - Rust + - Vim + - XSLT diff --git a/roles/contexts/fretlink/tasks/main.yml b/roles/contexts/fretlink/tasks/main.yml index 07861ed..78f733a 100644 --- a/roles/contexts/fretlink/tasks/main.yml +++ b/roles/contexts/fretlink/tasks/main.yml @@ -28,6 +28,25 @@ - [ "docsets", "path", "{{ lookup('env', 'XDG_DATA_HOME') }}/Zeal/Zeal/docsets" ] - [ "search", "fuzzy_search_enabled", "false" ] - [ "tabs", "open_new_tab_after_active", "false" ] +- name: Zeal docsets + block: + - name: Check missing Zeal docsets + register: zeal_missing_docsets + shell: "for i in {{ zeal_roles | join(' ') }}; do [ -d $XDG_DATA_HOME/Zeal/Zeal/docsets/$i.docset ] || echo $i; done" + changed_when: zeal_missing_docsets.stdout != "" + check_mode: no + - name: Ask for Zeal docsets + when: zeal_missing_docsets.stdout != "" + pause: + prompt: "install Zeal docsets ? [y/N]" + register: zeal_install_docsets + check_mode: no + - name: Zeal docsets + when: zeal_missing_docsets.stdout != "" and zeal_install_docsets.user_input.startswith("y") + shell: "dasht-docsets-install {{ item }}" + args: + creates: "$XDG_DATA_HOME/Zeal/Zeal/docsets/{{ item }}.docset" + loop: "{{ zeal_missing_docsets.stdout.split('\n') }}" - name: Create pm2 config dir file: path: $XDG_CONFIG_HOME/pm2 diff --git a/roles/init/templates/pam_environment.j2 b/roles/init/templates/pam_environment.j2 index fc65a10..3b8e96e 100644 --- a/roles/init/templates/pam_environment.j2 +++ b/roles/init/templates/pam_environment.j2 @@ -65,6 +65,9 @@ NPM_CONFIG_USERCONFIG DEFAULT="${XDG_CONFIG_HOME}/npm/npmrc" # TMUX TMUX_TMPDIR DEFAULT="${XDG_RUNTIME_DIR}" +# Zeal +DASHT_DOCSETS_DIR DEFAULT="${XDG_DATA_HOME}/Zeal/Zeal/docsets/" + # node_modules/pm2/paths.js PM2_HOME DEFAULT="${XDG_DATA_HOME}/pm2" PM2_CONF_FILE DEFAULT="${XDG_CONFIG_HOME}/pm2/conf.js" diff --git a/site.yml b/site.yml index 87f4858..28a64ed 100644 --- a/site.yml +++ b/site.yml @@ -22,4 +22,5 @@ - tools - gnupg - cron - - contexts/fretlink + - role: contexts/fretlink + tags: ["fretlink"] -- cgit v1.2.3