summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-02-25 15:46:24 +0900
committerKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-04-09 14:59:34 +0900
commit27b01f2b9106a9f29bd142be0cca2736c862ef1e (patch)
tree83cc3e6eed302a83d2d33c2ce73ef80a7bd0cd60
parent0e6e86197d40f5499c54f4288c38d63bfdcdb256 (diff)
find: find from specified dir
We want to find tasks from specified dir Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-rwxr-xr-xscripts/find.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/scripts/find.py b/scripts/find.py
index 2023842..89c9cee 100755
--- a/scripts/find.py
+++ b/scripts/find.py
@@ -73,6 +73,17 @@ class find(base.base):
self.files += self.run("egrep -l \"key:\s+{}\" -r {}/projects".\
format(key, self.top()))
+ # find specified folder files if exist
+ if (len(self.files) == 0):
+ did = 0
+ for folder in arg:
+ if (os.path.isdir(folder)):
+ did = 1
+ self.files += self.run("find {} -mindepth 1 -maxdepth 1 -name \"*.yaml\" | grep -v schema".\
+ format(folder))
+ if (did):
+ return
+
# all project files if no files
if (len(self.files) == 0):
self.files = self.run("find {}/projects -name \"*.yaml\" | grep -v schema".\
@@ -96,12 +107,13 @@ class find(base.base):
# -na : not matched assignee
# -t : matched team
# -nt : not matched team
- self.parse_option(arg, "-s", "status", 1)
- self.parse_option(arg, "-ns", "status", 0)
- self.parse_option(arg, "-a", "assignee", 1)
- self.parse_option(arg, "-na", "assignee", 0)
- self.parse_option(arg, "-t", "team", 1)
- self.parse_option(arg, "-nt", "team", 0)
+ if (self.files):
+ self.parse_option(arg, "-s", "status", 1)
+ self.parse_option(arg, "-ns", "status", 0)
+ self.parse_option(arg, "-a", "assignee", 1)
+ self.parse_option(arg, "-na", "assignee", 0)
+ self.parse_option(arg, "-t", "team", 1)
+ self.parse_option(arg, "-nt", "team", 0)
#--------------------
# get
@@ -113,7 +125,8 @@ class find(base.base):
# show
#--------------------
def show(self):
- print(self.files)
+ if (self.files):
+ print(self.files)
#====================================
#