Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k1LoW/execop
ExeCop is a checker that check commands and environment variables before execute command.
https://github.com/k1LoW/execop
bash checker zsh zsh-plugin
Last synced: 3 months ago
JSON representation
ExeCop is a checker that check commands and environment variables before execute command.
- Host: GitHub
- URL: https://github.com/k1LoW/execop
- Owner: k1LoW
- License: mit
- Created: 2017-08-22T09:26:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-27T00:57:54.000Z (about 7 years ago)
- Last Synced: 2024-06-28T07:33:13.325Z (5 months ago)
- Topics: bash, checker, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 75.2 KB
- Stars: 18
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ExeCop
ExeCop is a checker that check commands and environment variables before execute command.
![demo](demo.gif)
## Install
If you use Zsh, add the following line to your .zshrc
```zsh
. /path/to/execop.zsh
```If you use Bash, add the following line to your .bashrc
```bash
. /path/to/execop.bash
```## Usage
Put `.execop` file to `/path/to/dir` like `.htaccess`.
`.execop` file looks like following code
```
deny when command_match destroy
confirm when command_match rm
confirm when env_eq AWS_PROFILE=production
```## `.execop` file format
```
deny when command_match destroy
``````
[action] when [matcher] [command or environment value]
```| action | |
| --- | --- |
| `deny` | deny command if macther match |
| `confirm` | insert `yes/no` confirm if macther match || matcher | |
| --- | --- |
| `command_match` | command ~= value |
| `command_not_match` | ! command ~= value |
| `command_eq` | command = value |
| `command_not_eq` | command != value |
| `env_eq` | $SOMEENV = value |
| `env_not_eq` | $SOMEENV != value |