From 937c3f62636b71efd509929d8e66c201b65cc474 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sun, 11 Oct 2020 20:24:43 +0200 Subject: [PATCH] Fix VSCode installation Closes #7 Signed-off-by: Matej Focko --- playbooks/roles/vscode/tasks/main.yml | 7 ++++++- playbooks/roles/vscode/templates/update.sh.j2 | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/vscode/tasks/main.yml b/playbooks/roles/vscode/tasks/main.yml index 4696d97..ae3a1bd 100644 --- a/playbooks/roles/vscode/tasks/main.yml +++ b/playbooks/roles/vscode/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: Create directories for VSCode + block: + - shell: mkdir -p ~/.local/bin + - shell: mkdir -p ~/.local/share + - name: Install VSCode script template: src: templates/update.sh.j2 @@ -12,4 +17,4 @@ - name: Create app info for VSCode URL handler template: src: templates/code-url.desktop.j2 - dest: ~/.local/share/visual-studio-code-insiders-url-handler.desktop \ No newline at end of file + dest: ~/.local/share/visual-studio-code-insiders-url-handler.desktop diff --git a/playbooks/roles/vscode/templates/update.sh.j2 b/playbooks/roles/vscode/templates/update.sh.j2 index bd2f1e4..993c06a 100644 --- a/playbooks/roles/vscode/templates/update.sh.j2 +++ b/playbooks/roles/vscode/templates/update.sh.j2 @@ -26,6 +26,6 @@ fi # Check for *.desktop if ! ls /usr/share/applications | grep visual-studio-code; then echo ">>> Installing desktop files"; - DIRECTORY=/home/mfocko/git/mfocko/dotfiles/code-insiders - sudo cp $DIRECTORY/*.desktop /usr/share/applications/; + PATH_TO_APPS=/home/mfocko/.local/share/visual-studio-code-insiders + sudo cp $PATH_TO_APPS{,-url-handler}.desktop /usr/share/applications/; fi