Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xyproto/in
:open_file_folder: Create a directory if needed, then run the given command there
https://github.com/xyproto/in
chdir cli configure mkdir-recursive pushd rust shell small system-utility terminal utility
Last synced: 20 days ago
JSON representation
:open_file_folder: Create a directory if needed, then run the given command there
- Host: GitHub
- URL: https://github.com/xyproto/in
- Owner: xyproto
- License: bsd-3-clause
- Created: 2018-04-12T17:07:37.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T08:23:23.000Z (2 months ago)
- Last Synced: 2024-10-05T15:19:16.312Z (about 1 month ago)
- Topics: chdir, cli, configure, mkdir-recursive, pushd, rust, shell, small, system-utility, terminal, utility
- Language: Rust
- Homepage:
- Size: 277 KB
- Stars: 14
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![In Logo](img/logo.png)
[![Build](https://github.com/xyproto/in/actions/workflows/build.yml/badge.svg)](https://github.com/xyproto/in/actions/workflows/build.yml) [![License](https://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/in/main/LICENSE)
Utility to execute commands in directories, and create directories if needed.
It will also create the directories, if missing. If the top level directory is empty after executing the command, it will be removed. This means that `in testdirectory pwd` leaves no traces.
## Example 1
in build cmake ..
Instead of:
mkdir -p build
cd build
cmake ..
cd ..Or:
mkdir -p build
cmake -B build -S .## Example 2
in project ./configure --prefix=/usr
Instead of:
cd project
./configure --prefix=/usr
cd ..Or:
(cd project; ./configure --prefix=/usr)
Or:
pushd project
./configure --prefix=/usr
popd## Example 3
Globbing (note the double quotes to avoid shell expansion). No directories are created when using globbing, but the given command will be run in each directory where a matching file is found, for each matching file.
in "./**/*pom.xml" mvn clean
## Installation
### Linux
Manual installation, using `cargo`, `git`, `install` and `sudo`:
git clone https://github.com/xyproto/in
cd in
cargo build --release
sudo install -Dm755 target/release/in /usr/bin/in### FreeBSD
Manual installation, using `cargo`, `doas`, `git` and `install`:
git clone https://github.com/xyproto/in
cd in
cargo build --release
mkdir -p /usr/bin
doas install -m755 target/release/in /usr/bin/in## General info
* Version: 1.7.4
* License: BSD-3
* Author: Alexander F. Rødseth <[email protected]>