summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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)
#====================================
#