From 28ee5846bbac56926241fc5ef9f116161ceb6f23 Mon Sep 17 00:00:00 2001
From: Marc Cornellà <marc.cornella@live.com>
Date: Fri, 4 Sep 2020 21:50:00 +0200
Subject: init: define $ZSH if not defined

Closes #9223
---
 oh-my-zsh.sh | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'oh-my-zsh.sh')

diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 5b057256d..16e244be5 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -1,3 +1,6 @@
+# If ZSH is not defined, use the current script's directory.
+[[ -z "$ZSH" ]] && export ZSH="${${(%):-%x}:a:h}"
+
 # Set ZSH_CACHE_DIR to the path where cache files should be created
 # or else we will use the default cache/
 if [[ -z "$ZSH_CACHE_DIR" ]]; then
-- 
cgit v1.2.3-70-g09d2