Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kdeloach/scripty
Walk up from current directory and look for shell scripts in scripts/ folder
https://github.com/kdeloach/scripty
Last synced: 8 days ago
JSON representation
Walk up from current directory and look for shell scripts in scripts/ folder
- Host: GitHub
- URL: https://github.com/kdeloach/scripty
- Owner: kdeloach
- License: gpl-3.0
- Created: 2015-02-14T01:34:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-20T02:08:21.000Z (over 9 years ago)
- Last Synced: 2024-06-12T18:40:54.657Z (5 months ago)
- Language: Go
- Size: 144 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scripty
Run scripts from a nested directory without navigating up to project root.
## usage
Say you have the follow directory tree for a project you are developing,
```
~/project/
├── scripts
│ ├── bar.sh
│ ├── baz.py
│ ├── foo.sh
│ └── qux
└── src
└── subpackage
```where the contents of scripts are all executable.
You can execute these scripts, with or without file extensions, from any directory under `~/project/`:
```
[~/project/src/subpackage]$ scripty -l
bar
baz
foo
qux
[~/project/src/subpackage]$ scripty bar
# ... executes bar.sh
[~/project/src/subpackage]$ scripty bar.sh
# ... executes bar.sh```
## customization
Instead of looking for a `scripts` dir, you can set an environment variable `SCRIPTY_DIR` to the name
of a folder, without slashes, to look for scripts in.## bash completion
Depending on your platform, and setup, you can add bash completion in one of two ways:
#### binary only
If you downloaded a binary from the releases page, you can add bash completion with something like:
```shell
sudo bash -c "curl https://raw.githubusercontent.com/steventlamb/scripty/master/scripty_completion.sh > /etc/bash_completion.d/scripty"
```#### with source
Assuming you have scripty in your go path:
```shell
ln -s $GOPATH/scripty/scripty_completion.sh /etc/bash_completion.d/scripty
```## motivation
Scripty is inspired by the behavior of modern tools like fabric, vagrant, etc.
These tools allow you to run commands from any subdirectory of a project, which is very
convenient. I had gotten used to using fabric, and after switching to a folder full of
scripts for simplicity, I missed this functionality.