From 3e173a0fbf27cf379b94421c3a76b62457bdce30 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 24 May 2019 20:51:35 +0100 Subject: [PATCH] Uninstall unknown vscode extensions --- tasks/vscode.yml | 65 ++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/tasks/vscode.yml b/tasks/vscode.yml index b4aecb1..879824d 100644 --- a/tasks/vscode.yml +++ b/tasks/vscode.yml @@ -41,35 +41,46 @@ become_user: "{{ user }}" register: vscode_extensions +- set_fact: + requested_vscode_extensions: + - 'PKief.material-icon-theme' + - 'Zignd.html-css-class-completion' + - 'christian-kohler.npm-intellisense' + - 'dbaeumer.vscode-eslint' + - 'eamodio.gitlens' + - 'ms-vscode.vscode-typescript-tslint-plugin' + - 'ionutvmi.path-autocomplete' + - 'mrmlnc.vscode-less' + - 'mrmlnc.vscode-scss' + - 'ms-python.python' + - 'ms-vscode.sublime-keybindings' + - 'rokoroku.vscode-theme-darcula' + - 'truman.autocomplate-shell' + - 'wholroyd.jinja' + - 'formulahendry.auto-close-tag' + - 'James-Yu.latex-workshop' + - 'streetsidesoftware.code-spell-checker' + - 'EditorConfig.EditorConfig' + - 'vsciot-vscode.vscode-arduino' + - 'vscoss.vscode-ansible' + - 'rust-lang.rust' + - 'pnp.polacode' + - 'mrmlnc.vscode-duplicate' + - 'Tyriar.sort-lines' + - 'esbenp.prettier-vscode' + - 'jspolancor.presentationmode' + - 'ms-vscode.cpptools' + - name: "Install VSCode extensions" shell: "code --install-extension {{ item }} --force" become: true become_user: "{{ user }}" when: "item not in vscode_extensions.stdout_lines" - with_items: - - 'PKief.material-icon-theme' - - 'Zignd.html-css-class-completion' - - 'christian-kohler.npm-intellisense' - - 'dbaeumer.vscode-eslint' - - 'eamodio.gitlens' - - 'ms-vscode.vscode-typescript-tslint-plugin' - - 'ionutvmi.path-autocomplete' - - 'mrmlnc.vscode-less' - - 'mrmlnc.vscode-scss' - - 'ms-python.python' - - 'ms-vscode.sublime-keybindings' - - 'rokoroku.vscode-theme-darcula' - - 'truman.autocomplate-shell' - - 'wholroyd.jinja' - - 'formulahendry.auto-close-tag' - - 'James-Yu.latex-workshop' - - 'streetsidesoftware.code-spell-checker' - - 'editorconfig.editorconfig' - - 'vsciot-vscode.vscode-arduino' - - 'vscoss.vscode-ansible' - - 'rust-lang.rust' - - 'pnp.polacode' - - 'mrmlnc.vscode-duplicate' - - 'Tyriar.sort-lines' - - 'esbenp.prettier-vscode' - - 'jspolancor.presentationmode' + with_items: "{{ requested_vscode_extensions }}" + +- name: "Remove unversioned VSCode extensions" + shell: "code --uninstall-extension {{ item }}" + become: true + become_user: "{{ user }}" + when: "item not in requested_vscode_extensions" + with_items: "{{ vscode_extensions.stdout_lines }}"