From a7ea505866919696c964c7d29a3b6bddccde2de8 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Mon, 31 Oct 2022 17:21:24 +0000 Subject: [PATCH] Adds env var checking to symlinks file --- symlinks.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/symlinks.yaml b/symlinks.yaml index 42923d4..5856da4 100644 --- a/symlinks.yaml +++ b/symlinks.yaml @@ -6,9 +6,28 @@ - clean: ['~', '${XDG_CONFIG_HOME}'] - shell: - # Before symlinking, source .zshenv in order to set XDG variables - description: Set XDG environmental variables command: source ./zsh/.zshenv + - description: Check that $XDG_CONFIG_HOME is set + command: > + if [ -z ${XDG_CONFIG_HOME+x} ]; then; \ + echo "XDG_CONFIG_HOME is not yet set. Will use ~/.config"; \ + XDG_CONFIG_HOME="${HOME}/.config"; \ + fi + stdin: false + stdout: true + stderr: true + quiet: true + - description: Check that $XDG_DATA_HOME is set + command: > + if [ -z ${XDG_DATA_HOME+x} ]; then; \ + echo "XDG_DATA_HOME is not yet set. Will use ~/.local/share"; \ + XDG_DATA_HOME="${HOME}/.local/share"; \ + fi + stdin: false + stdout: true + stderr: true + quiet: true # Symlink locations for files / directories - link: