-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: aeneasr <aeneas.rekkas@serlo.org>
- Loading branch information
aeneasr
committed
Oct 23, 2018
1 parent
57919ad
commit 292fb18
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/ory/x/cmdx" | ||
"os" | ||
"path/filepath" | ||
"strings" | ||
) | ||
|
||
func main() { | ||
args := os.Args | ||
if len(args) != 2 { | ||
cmdx.Fatalf("Expects exactly one input parameter") | ||
} | ||
err := filepath.Walk(args[1], func(path string, info os.FileInfo, err error) error { | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if info.IsDir() { | ||
return nil | ||
} | ||
|
||
if strings.Contains(path, "vendor") { | ||
return nil | ||
} | ||
|
||
if filepath.Ext(path) == ".go" { | ||
if p, err := filepath.Abs(filepath.Join(args[1], path)); err != nil { | ||
return err | ||
} else { | ||
fmt.Println(p) | ||
} | ||
} | ||
|
||
return nil | ||
}) | ||
|
||
cmdx.Must(err, "%s", err) | ||
} |