- (let*
- ((val (getenv var))
- (paths (string-split val #\:))
- (without (remove (lambda (s) (string-contains s pat))
- paths)))
-
- (if (not (= (length without)
- (length paths)))
- (setenv var (string-join without ":")))))
+ (if (getenv var)
+ (let*
+ ((val (getenv var))
+ (paths (string-split val #\:))
+ (without (remove (lambda (s) (string-contains s pat))
+ paths)))
+
+ (if (not (= (length without)
+ (length paths)))
+ (setenv var (string-join without ":"))))))