Skip to content

Commit

Permalink
Allow opt-out of dotfile sourcing (#275)
Browse files Browse the repository at this point in the history
* allow opt-out of dotfile sourcing

* update README with examples of suppressing environment files
  • Loading branch information
drinks authored Apr 15, 2021
1 parent e2f24c8 commit 2b81b85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@ Puma-dev supports loading environment variables before puma starts. It checks fo
* `.powenv`
* `.pumaenv`

Additionally, puma-dev uses a few environment variables to control how puma is started that you can overwrite in your loaded shell config.
You can prevent puma-dev from loading any of these environment files by setting a corresponding environment variable to '0':

* `PUMADEV_SOURCE_POWCONFIG=0`
* `PUMADEV_SOURCE_ENV=0`
* `PUMADEV_SOURCE_POWRC=0`
* `PUMADEV_SOURCE_POWENV=0`
* `PUMADEV_SOURCE_PUMAENV=0`

Additionally, puma-dev uses a few other environment variables to control how puma is started that you can overwrite in your loaded shell config.

* `CONFIG`: A puma configuration file to load, usually something like `config/puma-dev.rb`. Defaults to no config.
* `THREADS`: How many threads puma should use concurrently. Defaults to 5.
Expand Down
10 changes: 5 additions & 5 deletions dev/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,23 +236,23 @@ func (a *App) Log() string {
const executionShell = `exec bash -c '
cd %s
if test -e ~/.powconfig; then
if test -e ~/.powconfig && [ "$PUMADEV_SOURCE_POWCONFIG" != "0" ]; then
source ~/.powconfig
fi
if test -e .env; then
if test -e .env && [ "$PUMADEV_SOURCE_ENV" != "0" ]; then
source .env
fi
if test -e .powrc; then
if test -e .powrc && [ "$PUMADEV_SOURCE_POWRC" != "0" ]; then
source .powrc
fi
if test -e .powenv; then
if test -e .powenv && [ "$PUMADEV_SOURCE_POWENV" != "0" ]; then
source .powenv
fi
if test -e .pumaenv; then
if test -e .pumaenv && [ "$PUMADEV_SOURCE_PUMAENV" != "0" ]; then
source .pumaenv
fi
Expand Down

0 comments on commit 2b81b85

Please sign in to comment.