in

command module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

README

logo

in Build

A command for running a command within another directory or directories matching a glob pattern.

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. When running in multiple directories, it will not create any new directories.

Example 1

in build cmake ..

Instead of:

mkdir -p build
cd build
cmake ..

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

Support for globs via filepath.Glob which allows you to do something like (note the quotes which prevent a shell like bash from handling the globbing itself):

in "./**/*pom.xml" mvn clean

Installation

Either download the binary release (for 64-bit Linux), or install the development version (using go install like this requires Go 1.19 or later):

go install github.com/xyproto/in@latest

Manual installation, using git, go, sudo and install:

git clone https://github.com/xyproto/in
cd in
go build
sudo install -Dm755 in /usr/bin/in

Dependencies

  • Go 1.19 or later

When compiling with GCC 10.2.0 (gccgo), the in executable is only 41k here.

General info

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL