Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Granitosaurus/xonsh-autoxsh
Automatically execute scripts for directories in Xonsh Shell.
https://github.com/Granitosaurus/xonsh-autoxsh
shell xonsh xontrib
Last synced: about 1 month ago
JSON representation
Automatically execute scripts for directories in Xonsh Shell.
- Host: GitHub
- URL: https://github.com/Granitosaurus/xonsh-autoxsh
- Owner: Granitosaurus
- License: gpl-3.0
- Created: 2016-06-27T12:51:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T11:55:20.000Z (over 3 years ago)
- Last Synced: 2024-05-17T03:11:46.289Z (7 months ago)
- Topics: shell, xonsh, xontrib
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 15
- Watchers: 4
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xontribs - autoxsh - Adds automatic execution of xonsh script files called `.autoxsh` when enterting a directory with `cd` function. (Plugins / Prompt tweaks)
README
# xonsh-autoxsh
Automatically execution of `.autoxsh` xonsh script after entering (cd-ing) into the directory.
[![PyPi version](https://img.shields.io/pypi/v/xonsh-autoxsh.svg?style=flat-square)](https://pypi.python.org/pypi/xonsh-autoxsh) [![PyPi license](https://img.shields.io/pypi/l/xonsh-autoxsh.svg?style=flat-square)](https://pypi.python.org/pypi/xonsh-autoxsh) [![PyPi license](https://img.shields.io/pypi/pyversions/xonsh-autoxsh.svg?style=flat-square)](https://pypi.python.org/pypi/xonsh-autoxsh)
## Installation
```python
pip install xonsh-autoxsh
# OR: pip install git+https://github.com/Granitas/xonsh-autoxsh
echo 'xontrib load autoxsh' >> ~/.xonshrc
```## Use cases
### Run xonsh script after entering (cd-ing) into the directory
```python
mkdir -p /tmp/dir
echo "print('it works!')" > /tmp/dir/.autoxsh
cd /tmp/dir
# Unauthorized ".autoxsh" file found in this directory. Authorize and invoke? (y/n/ignore): y
# it works!
cd /
cd /tmp/dir
# it works!
```### Activate Python virtual environment with vox
```python
xontrib load vox
vox new myenv
mkdir -p /tmp/dir
echo "vox activate myenv" > /tmp/dir/.autoxsh
cd /tmp/dir
# Activated "myenv".
```## Links
* This package is the part of [ergopack](https://github.com/anki-code/xontrib-ergopack) - the pack of ergonomic xontribs.
* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).