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

Unified Diff: tools/dom/dom.py

Issue 14791007: fix dom.py -- initdir was not right if running from a relative path (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/dom.py
diff --git a/tools/dom/dom.py b/tools/dom/dom.py
index 5832af47e5ab4f6b143561bc11f7fe70088b5d1b..15697b30b13ca2183a880475b7ff32961daea1a1 100755
--- a/tools/dom/dom.py
+++ b/tools/dom/dom.py
@@ -20,6 +20,10 @@ if utils.IsWindows():
else:
dart_bin = os.path.join(dart_out_dir, 'dart')
+dart_dir = os.path.abspath(os.path.join(
+ os.path.dirname(os.path.realpath(__file__)),
+ os.path.pardir, os.path.pardir))
+
def help():
print('Helper script to make it easy to perform common tasks encountered '
'during the life of a Dart DOM developer.\n'
@@ -166,13 +170,6 @@ def call(args):
print error
return pipe.returncode
-def init_dir():
- ''' Makes sure that we're always rooted in the dart root folder.'''
- dart_dir = os.path.abspath(os.path.join(
- os.path.dirname(os.path.realpath(__file__)),
- os.path.pardir, os.path.pardir))
- os.chdir(dart_dir)
-
commands = {
'analyze': [analyze, 'Run the dart analyzer'],
'build': [build, 'Build dart in release mode'],
@@ -201,7 +198,8 @@ def main():
success = False
while (argv):
- init_dir()
+ # Make sure that we're always rooted in the dart root folder.
+ os.chdir(dart_dir)
command = argv.pop(0)
if not command in commands:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698