Granitosaurus / xonsh-autoxsh

Automatically execute scripts for directories in Xonsh Shell.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xonsh-autoxsh

Automatically execution of .autoxsh xonsh script after entering (cd-ing) into the directory.

PyPi version PyPi license PyPi license

Installation

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

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

xontrib load vox
vox new myenv
mkdir -p /tmp/dir
echo "vox activate myenv" > /tmp/dir/.autoxsh
cd /tmp/dir
# Activated "myenv".

Links

About

Automatically execute scripts for directories in Xonsh Shell.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%