]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - bin/find_file_paths
Moved the post_data() function in to its own static Javascript file.
[dead/census-tools.git] / bin / find_file_paths
index cf4d9c51260d30d69785f1cbfe1662459e357f03..47618281d5deba2817494f237cbb3419e4ca6ece 100755 (executable)
@@ -63,25 +63,9 @@ if len(args) < 1:
     raise SystemExit(ExitCodes.NOT_ENOUGH_ARGS)
 
 
-found_paths = []
-
-# Build a list of found paths, in case there are / we want more than
-# one.
-for filename in args:
-    # If --single was passed, we relay it to the find_file_paths
-    # function so that it completes sooner (it doesn't have to keep
-    # looking after the first match).
-    found_paths += FileUtils.find_file_paths(options.root,
-                                             filename,
-                                             options.single)
-    
-    if options.single and (len(found_paths) > 0):
-        # If we found anything and we only want the first match, just
-        # print it and quit.
-        print found_paths[0]
-        raise SystemExit(ExitCodes.EXIT_SUCCESS)
-
-
-# If we weren't passed --single, spit out all matches.
+found_paths = FileUtils.find_file_paths(options.root,
+                                        args,
+                                        options.single)
+
 for fp in found_paths:
     print fp