inline measure glob
This commit is contained in:
parent
e84e68b481
commit
afefc4e649
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
build
|
||||
tool/build-html-inner
|
||||
tool/number
|
||||
tool/measure-inner
|
||||
tool/measure
|
||||
|
||||
|
@ -4,4 +4,4 @@ set -e
|
||||
|
||||
go build -o tool/build-html-inner tool/src/build-html-inner.go
|
||||
go build -o tool/number tool/src/number.go
|
||||
go build -o tool/measure-inner tool/src/measure-inner.go
|
||||
go build -o tool/measure tool/src/measure.go
|
||||
|
@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
ls src/0*/*.{go,sh} | xargs tool/measure-inner
|
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -20,12 +21,10 @@ func readLines(path string) []string {
|
||||
}
|
||||
|
||||
func main() {
|
||||
if len(os.Args) <= 1 {
|
||||
fmt.Fprintln(os.Stderr, "usage: tool/measure *.{go,sh}")
|
||||
os.Exit(1)
|
||||
}
|
||||
sourcePaths, err := filepath.Glob("./src/0*/*")
|
||||
check(err)
|
||||
foundLongFile := false
|
||||
for _, sourcePath := range os.Args[1:] {
|
||||
for _, sourcePath := range sourcePaths {
|
||||
foundLongLine := false
|
||||
lines := readLines(sourcePath)
|
||||
for _, line := range lines {
|
Loading…
x
Reference in New Issue
Block a user