:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
;;; core/cli/env.el -*- lexical-binding: t; -*-
|
|
|
|
|
2019-07-28 01:32:16 +02:00
|
|
|
(defcli! env (&rest args)
|
2019-08-07 01:42:46 -04:00
|
|
|
"Creates or regenerates your envvars file.
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
2019-07-25 19:42:01 +02:00
|
|
|
doom env [-c|--clear]
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
2019-08-07 01:42:46 -04:00
|
|
|
This is meant to be a faster and more comprehensive alternative to
|
|
|
|
exec-path-from-shell. See the FAQ in the documentation for an explanation why.
|
2019-07-25 19:42:01 +02:00
|
|
|
|
2019-08-07 01:42:46 -04:00
|
|
|
The envvars file is created by scraping your (interactive) shell environment
|
|
|
|
into newline-delimited KEY=VALUE pairs. Typically by running '$SHELL -ic env'
|
|
|
|
(or '$SHELL -c set' on windows). Doom loads this file at startup (if it exists)
|
|
|
|
to ensure Emacs mirrors your shell environment (particularly to ensure PATH and
|
|
|
|
SHELL are correctly set).
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
2019-08-07 01:42:46 -04:00
|
|
|
This is useful in cases where you cannot guarantee that Emacs (or the daemon)
|
|
|
|
will be launched from the correct environment (e.g. on MacOS or through certain
|
|
|
|
app launchers on Linux).
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
2019-08-07 01:42:46 -04:00
|
|
|
This file is automatically regenerated when you run this command or 'doom
|
|
|
|
refresh'. However, 'doom refresh' will only regenerate this file if it exists.
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
2019-08-07 01:42:46 -04:00
|
|
|
Use the -c or --clear switch to delete your envvar file."
|
2019-09-05 14:20:50 -04:00
|
|
|
(when (member "clear" args) ; DEPRECATED
|
|
|
|
(message "'doom env clear' is deprecated. Use 'doom env -c' or 'doom env --clear' instead")
|
|
|
|
(push "-c" args))
|
|
|
|
(let ((env-file (or (cadr (member "-o" args))
|
|
|
|
doom-env-file)))
|
2019-07-25 19:42:01 +02:00
|
|
|
(cond ((or (member "-c" args)
|
|
|
|
(member "--clear" args))
|
2019-09-05 14:20:50 -04:00
|
|
|
(unless (file-exists-p env-file)
|
2019-07-25 19:42:01 +02:00
|
|
|
(user-error! "%S does not exist to be cleared"
|
2019-09-09 13:44:12 -04:00
|
|
|
(path env-file)))
|
2019-09-05 14:20:50 -04:00
|
|
|
(delete-file env-file)
|
2019-07-25 19:42:01 +02:00
|
|
|
(print! (success "Successfully deleted %S")
|
2019-09-09 13:44:12 -04:00
|
|
|
(path env-file)))
|
2019-07-25 19:42:01 +02:00
|
|
|
|
2019-09-05 14:20:50 -04:00
|
|
|
((or (null args)
|
|
|
|
(member "-o" args))
|
|
|
|
(doom-reload-env-file 'force env-file))
|
2019-07-25 19:42:01 +02:00
|
|
|
|
|
|
|
((user-error "I don't understand 'doom env %s'"
|
|
|
|
(string-join args " "))))))
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Helpers
|
|
|
|
|
2019-04-03 00:08:06 -04:00
|
|
|
(defvar doom-env-ignored-vars
|
2019-07-10 15:06:45 +02:00
|
|
|
'("^PWD$"
|
|
|
|
"^PS1$"
|
|
|
|
"^R?PROMPT$"
|
|
|
|
"^DBUS_SESSION_BUS_ADDRESS$"
|
|
|
|
"^GPG_AGENT_INFO$"
|
|
|
|
"^SSH_AGENT_PID$"
|
|
|
|
"^SSH_AUTH_SOCK$"
|
2019-03-28 14:47:31 -04:00
|
|
|
;; Doom envvars
|
2019-07-10 15:06:45 +02:00
|
|
|
"^INSECURE$"
|
|
|
|
"^DEBUG$"
|
2019-07-27 00:01:44 +02:00
|
|
|
"^YES$"
|
|
|
|
"^__")
|
2019-06-25 18:38:27 +02:00
|
|
|
"Environment variables to not save in `doom-env-file'.
|
|
|
|
|
|
|
|
Each string is a regexp, matched against variable names to omit from
|
|
|
|
`doom-env-file'.")
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
|
2019-04-03 00:08:06 -04:00
|
|
|
(defvar doom-env-executable
|
|
|
|
(if IS-WINDOWS
|
|
|
|
"set"
|
|
|
|
(executable-find "env"))
|
|
|
|
"The program to use to scrape your shell environment with.
|
|
|
|
It is rare that you'll need to change this.")
|
|
|
|
|
|
|
|
(defvar doom-env-switches
|
|
|
|
(if IS-WINDOWS
|
2019-05-17 21:34:21 -04:00
|
|
|
"-c"
|
|
|
|
"-ic") ; Execute in an interactive shell
|
2019-04-03 00:08:06 -04:00
|
|
|
"The `shell-command-switch'es to use on `doom-env-executable'.
|
|
|
|
This is a list of strings. Each entry is run separately and in sequence with
|
|
|
|
`doom-env-executable' to scrape envvars from your shell environment.")
|
|
|
|
|
2019-09-05 14:20:50 -04:00
|
|
|
(defun doom-reload-env-file (&optional force-p env-file)
|
2019-06-25 18:38:27 +02:00
|
|
|
"Generates `doom-env-file', if it doesn't exist (or if FORCE-P).
|
2019-04-03 00:08:06 -04:00
|
|
|
|
2019-06-25 18:38:27 +02:00
|
|
|
This scrapes the variables from your shell environment by running
|
|
|
|
`doom-env-executable' through `shell-file-name' with `doom-env-switches'. By
|
|
|
|
default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in
|
|
|
|
`doom-env-ignored-vars' are removed."
|
2019-09-05 14:20:50 -04:00
|
|
|
(let ((env-file (if env-file
|
|
|
|
(expand-file-name env-file)
|
|
|
|
doom-env-file)))
|
|
|
|
(when (or force-p (not (file-exists-p env-file)))
|
|
|
|
(with-temp-file env-file
|
|
|
|
(print! (start "%s envvars file at %S")
|
|
|
|
(if (file-exists-p env-file)
|
|
|
|
"Regenerating"
|
|
|
|
"Generating")
|
2019-09-09 13:44:12 -04:00
|
|
|
(path env-file))
|
2019-09-05 14:20:50 -04:00
|
|
|
(let ((process-environment doom--initial-process-environment))
|
|
|
|
(let ((shell-command-switch doom-env-switches)
|
|
|
|
(error-buffer (get-buffer-create "*env errors*")))
|
|
|
|
(print! (info "Scraping shell environment with '%s %s %s'")
|
|
|
|
(filename shell-file-name)
|
|
|
|
shell-command-switch
|
|
|
|
(filename doom-env-executable))
|
|
|
|
(save-excursion
|
|
|
|
(shell-command doom-env-executable (current-buffer) error-buffer))
|
|
|
|
(print-group!
|
|
|
|
(let ((errors (with-current-buffer error-buffer (buffer-string))))
|
|
|
|
(unless (string-empty-p errors)
|
2019-09-12 13:25:42 -04:00
|
|
|
(print! (info "Warnings:\n\n%s") (indent 4 errors))))
|
2019-09-05 14:20:50 -04:00
|
|
|
;; Remove undesireable variables
|
|
|
|
(insert
|
|
|
|
(concat
|
|
|
|
"# -*- mode: dotenv -*-\n"
|
|
|
|
(format "# Generated with: %s %s %s\n"
|
|
|
|
shell-file-name
|
|
|
|
doom-env-switches
|
|
|
|
doom-env-executable)
|
|
|
|
"# ---------------------------------------------------------------------------\n"
|
|
|
|
"# This file was auto-generated by `doom env'. It contains a list of environment\n"
|
|
|
|
"# variables scraped from your default shell (excluding variables blacklisted\n"
|
|
|
|
"# in doom-env-ignored-vars).\n"
|
|
|
|
"#\n"
|
|
|
|
"# It is NOT safe to edit this file. Changes will be overwritten next time that\n"
|
2019-09-09 13:51:36 -04:00
|
|
|
"# `doom refresh` is executed. Alternatively, create your own env file with\n"
|
|
|
|
"# `doom env -o ~/.doom.d/myenv`, then load it with (doom-load-envvars-file FILE)\n"
|
|
|
|
"# in your private config.el.\n"
|
2019-09-05 14:20:50 -04:00
|
|
|
"# ---------------------------------------------------------------------------\n\n"))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (re-search-forward "\n\\([^= \n]+\\)=" nil t)
|
|
|
|
(save-excursion
|
|
|
|
(let* ((valend (or (save-match-data
|
|
|
|
(when (re-search-forward "^\\([^= ]+\\)=" nil t)
|
|
|
|
(line-beginning-position)))
|
|
|
|
(point-max)))
|
|
|
|
(var (match-string 1)))
|
|
|
|
(when (cl-loop for regexp in doom-env-ignored-vars
|
|
|
|
if (string-match-p regexp var)
|
|
|
|
return t)
|
|
|
|
(print! (info "Ignoring %s") var)
|
|
|
|
(delete-region (match-beginning 0) (1- valend)))))))
|
|
|
|
(print! (success "Successfully generated %S")
|
2019-09-09 13:44:12 -04:00
|
|
|
(path env-file))
|
2019-09-05 14:20:50 -04:00
|
|
|
t))))))
|