https://github.com/xfgusta/execdir
Execute a command in a specific directory
https://github.com/xfgusta/execdir
aliases c cli command directory exec execute-command path run-command shell system working-directory
Last synced: 6 months ago
JSON representation
Execute a command in a specific directory
- Host: GitHub
- URL: https://github.com/xfgusta/execdir
- Owner: xfgusta
- License: mit
- Created: 2022-06-20T21:40:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-03T14:26:28.000Z (over 3 years ago)
- Last Synced: 2023-03-08T05:00:42.863Z (about 3 years ago)
- Topics: aliases, c, cli, command, directory, exec, execute-command, path, run-command, shell, system, working-directory
- Language: C
- Homepage:
- Size: 43 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# execdir
A tool that lets you run a command in a specific directory. It supports shell commands and path aliases. **execdir** will try to get an alias if the path doesn't exist.
There is also a symlink called **x**, so you can type less using it.
## Examples
Run a command in a specific directory:
```text
$ execdir ~/Fedora/SCM/nq git status
On branch rawhide
Your branch is up to date with 'origin/rawhide'.
nothing to commit, working tree clean
```
Run a shell command in a specific directory:
```text
$ execdir -s ~/Desktop echo \$PWD
/home/xfgusta/Desktop
```
Create an alias for a path:
```text
$ execdir -a nq ~/Fedora/SCM/nq
```
Use an alias:
```text
$ execdir nq pwd
/home/xfgusta/Fedora/SCM/nq
```
List all aliases:
```text
$ execdir -l
nq /home/xfgusta/Fedora/SCM/nq
```
Delete an alias:
```text
$ execdir -r nq
```
## Installation
### Arch Linux
[**execdir**](https://aur.archlinux.org/packages/execdir) package from AUR
```text
git clone https://aur.archlinux.org/execdir.git
cd execdir
makepkg -si
```
### Fedora Linux
[**execdir**](https://copr.fedorainfracloud.org/coprs/xfgusta/execdir/) package from Copr
```text
dnf copr enable xfgusta/execdir
dnf install execdir
```
### From source
The install directory defaults to `/usr/local`:
```text
make install
```
You can install **execdir** in a different directory using the `PREFIX` variable:
```text
make PREFIX=/usr install
```
## License
Copyright (c) 2022 Gustavo Costa. Distributed under the MIT license.