Giter Site home page Giter Site logo

xyproto / in Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 1.0 277 KB

:open_file_folder: Create a directory if needed, then run the given command there

License: BSD 3-Clause "New" or "Revised" License

Roff 7.92% Shell 35.15% Rust 51.20% Makefile 5.73%
utility shell cmake configure mkdir-recursive pushd small cli chdir console

in's Introduction

In Logo

Build License Stand With Ukraine

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 ..

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

in's People

Contributors

xyproto avatar zikani03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zikani03

in's Issues

no such file or directory

The program doesn't seem to be working for me.

~/Dev/GHQ/github.com/xyproto/in main
❯ in build touch test
2023/08/15 00:14:13 chdir /home/grimnight/Dev/GHQ/github.com/xyproto/in/build/build: no such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.