ls-having command - github.com/handy-common-utils/ls-having - Go Packages

ls-having

command module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

ls-having

This is a tool that can list directories having specified flag files and optionally meeting other specified conditions.

Usage - as a CLI tool

Find all directories in ./ having package.json file, go as deep as 8 levels, and don't apply default excludes (such like .git and node_modules):

ls-having -f package.json -d 8 -n

Find all directories in testdata/repo1 having serverless.* (such like serverless.yml, serverless.ts, serverless.js), and also having package.json:

ls-having  -f 'serverless.*' -c package.json testdata/repo1

Find all directories in ./ having package.json, and the package.json file must contain text mocha:

ls-having -f 'package.json' -c package.json -e 'mocha'

Find all subdirectories under ./ (the root directory ./ is excluded) having package.json, and also having serverless.yml file contain text datadog:

ls-having -f 'package.json' -c serverless.yml -e 'datadog' -s

Find all subdirectories under /tmp/sample/repo (the root directory ./ is excluded) having build.gradle* or mvn.xml:

ls-having -f 'build.gradle*' -f 'mvn.xml' -s /tmp/sample/repo

Usage - as a Go package

import (
	"fmt"
	"github.com/handy-common-utils/ls-having/lsh"
)

func main() {
	var dirs = lsh.LsHaving(&lsh.Options{
		// options here
	}, rootDir)
	fmt.Println(dirs)
}

See main.go for example.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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