Skip to content

Prep for v0.4.0 release #242

Open
Open
@hyperupcall

Description

@hyperupcall

Prep for release

This issue notes the things left to do before the long-awaited v0.4.0 release. I'll be adding things as I get closer to release date.

Remaining TODOs

  • At-mention contributors to have help contribute certain features or bug-fixes (thanks!)
  • Add more "recommended" configuration to docs so people have good defaults
  • Tweak AUTOENV_VIEWER and add ability to revert to old prompt screen (compat)
  • Finalize release notes
  • master -> main transision

Release

  • add to changelog.md, increment version num
  • git tag
  • make pr
  • github release

Release notes (WIP) [v0.4.0 Feature release]

Another yet-again long-awaited release! 🥳

As per the title, this mostly includes features, but also includes the usual bug fixes, documentation updates, and maintenance chores.

Features

  • Add ability to permanently not source particular .env files.

When cding to a directory with an .env (by default) file, autoenv used to always prompt to source the file:

$ cd ./dir
autoenv: WARNING:
autoenv: This is the first time you are about to source /home/edwin/Documents/Programming/autoenv/.hidden/.env:
autoenv:
autoenv:   --- (begin contents) ---------------------------------------
autoenv:     echo '.env has been sourced.'$
autoenv:
autoenv:   --- (end contents) -----------------------------------------
autoenv: Are you sure you want to allow this? (y/N)

Even when selecting n (no), autoenv would not remember that choice. Now, there is a new option:

[autoenv] New or modified env file detected:
--- .env contents -----------------------------------------------------------------------------------------------------

echo '.env has been sourced.'
-----------------------------------------------------------------------------------------------------------------------

[autoenv] Authorize this file? (y/N/D) 

Choose d (disable) if you no longer want any "source prompts" for this file. Note that if the file content changes, then your choice is "reset" and autoenv will prompt you yet again.

The AUTOENV_NOTAUTH_FILE shell variable is used to configurel where this data is stored. It's structure is identical to AUTOENV_AUTH_FILE.

  • Support the XDG Base Directory Specification

The XDG Base Directory Specification is now adhered to. Some details:

  • On a fresh install, both AUTOENV_AUTH_FILE and AUTOENV_NOTAUTH_FILE are written under $HOME/.local/state/autoenv

  • If AUTOENV_AUTH_FILE is written under $HOME, then AUTOENV_NOTAUTH_FILE will also be written under there (for consistency)

  • For maximum backwards-compatability, files are not moved to the new location; the old locations can still be used

  • Support customizing the "env file prompt"

As you may have noticed in the above example, the prompt has been upgraded to read better. You can also customize this with the AUTOENV_VIEWER variable. Set it to an executable like cat or `less.

  • Prevent overriding cd with AUTOENV_PRESERVE_CD

It's not uncommon to customize cd so multiple tools are executed. Previously, autoenv would run:

cd() {
	autoenv_cd "${@}"
}

This would override any pre-existing cd function, making it a bit annoying to work around. Now set AUTOENV_PRESERVE_CD to a non-empty string to prevent this behavior. autoenv_cd will still be exposed for usage.

Fixes

  • That path bugfix

Other

  • Improve installation process

  • Improve installation instructions

  • Add install script under scripts/install.sh

  • Add documentation for uninstalling tool

  • Improve documentation for variables

Document the AUTOENV_CUR_FILE and AUTOENV_CUR_DIR environment variables. They've always existed, but documenting it will make clear that their use is part of the "backwards compatibility promise"

  • Behind the scenes improvements
  • Remove backslahshes before builtins for better readability
    • This is technically a breaking change. This significantly enhances code readability and anybody that overrides a builtin with a user-defined function should know what they are doing. Of course, prepending command to external commands is still done.
  • Various refactorings to make reading code easier
  • Implement some tests in Bats

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions