https://github.com/nickcox/ps-autoenv
PowerShell implementation of autoenv (https://github.com/kennethreitz/autoenv)
https://github.com/nickcox/ps-autoenv
cli command-line-tool powershell powershell-module
Last synced: 2 months ago
JSON representation
PowerShell implementation of autoenv (https://github.com/kennethreitz/autoenv)
- Host: GitHub
- URL: https://github.com/nickcox/ps-autoenv
- Owner: nickcox
- License: mit
- Created: 2018-01-16T22:54:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T13:24:29.000Z (about 7 years ago)
- Last Synced: 2024-02-26T09:59:28.139Z (over 2 years ago)
- Topics: cli, command-line-tool, powershell, powershell-module
- Language: PowerShell
- Homepage:
- Size: 5.86 KB
- Stars: 18
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
PowerShell implementation of [autoenv](https://github.com/kennethreitz/autoenv) directory based environments.
What is it?
===========
If a directory contains a .autoenv file, it will automatically be executed when you cd into it. When enabled (set `$autoenv:ENABLE_LEAVE` to `$true`), if a directory contains a .autoenv.leave file, it will automatically be executed when you leave it.
This is great for...
* auto-activating virtualenvs
* auto-deactivating virtualenvs
* project-specific environment variables
Usage
==========
```
PS> Import-Module ps-autoenv
PS> "echo 'whoa'" > project/.autoenv
PS> cd project
whoa
```
Install
==========
```
PS> Install-Module ps-autoenv
PS> Add-Content $PROFILE @("`n", "import-module ps-autoenv")
```
Configuration
============
Update these properties of `$autoenv` at any time:
* AUTH_FILE: Location of a text file which contains a list of authorized env files;
defaults to ~/.autoenv_authorized
* ENV_FILENAME: Name of the enter file; defaults to .autoenv
* ENV_LEAVE_FILENAME: Name of the leave file; defaults to .autoenv.leave
* ENABLE_LEAVE: Set this to a non-falsy value in order to enable leave scripts
* ASSUME_YES: Set this to $true to automatically authorize the initialization of new environments