Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Unified Diff: mojo/public/tools/dart_list_packages_contents.py

Issue 1063233004: Teach dart_package to understand the packages/ subdirectory (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/dart/rules.gni ('k') | mojo/public/tools/git/dart_pub_get.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/dart_list_packages_contents.py
diff --git a/mojo/public/tools/dart_list_packages_contents.py b/mojo/public/tools/dart_list_packages_contents.py
new file mode 100755
index 0000000000000000000000000000000000000000..b8fbbdc39e836da872432b4c4cfc6b10484f133f
--- /dev/null
+++ b/mojo/public/tools/dart_list_packages_contents.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""This script outputs the filenames of the files that are in the "packages/"
+subdir of the given directory, relative to that directory."""
+
+import argparse
+import os
+import sys
+
+def main(target_directory):
+ os.chdir(target_directory)
+ for root, _, files in os.walk("packages", followlinks=True):
+ for f in files:
+ print os.path.join(root, f)
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description="List filenames of files in the packages/ subdir of the "
+ "given directory.")
+ parser.add_argument("--target-directory",
+ dest="target_directory",
+ metavar="<target-directory>",
+ type=str,
+ required=True,
+ help="The target directory, specified relative to this "
+ "directory.")
+ args = parser.parse_args()
+ sys.exit(main(args.target_directory))
« no previous file with comments | « mojo/public/dart/rules.gni ('k') | mojo/public/tools/git/dart_pub_get.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698