Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "-s" option to delete dotenv files on command failure #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 26, 2021

  1. Add "-s" option to delete dotenv files on command failure

    Rationale: sometimes we want to secure our environment variables so that the next command cannot access them.
    We can chain the two operations:
    
    ```
    godotenv cmd
    rm .env
    ```
    
    The problem here is if the command fails, we do not remove the file.
    
    We can code some shell:
    
    ```
    godotenv cmd || rm cmd && exit 1
    ```
    
    There are two problems now:
    
    1. We lose the original exit code.
    2. We have to write this for each executed command.
    
    `godotenv -s` solves everything.
    vmarkovtsev committed Apr 26, 2021
    Configuration menu
    Copy the full SHA
    c6e8ca9 View commit details
    Browse the repository at this point in the history