Commit 75f2f1ab authored by Ian Hickson's avatar Ian Hickson

Merge pull request #290 from TheBosZ/master

Move Python script over to Dart.
parents 0a1385d9 9d016b7c
......@@ -42,7 +42,7 @@ Getting the code and configuring your environment
* `git remote add upstream git@github.com:flutter/flutter.git` (So that you
fetch from the master repository, not your clone, when running `git fetch`
et al.)
* Run `./dev/update_packages.py` This will fetch all the Dart packages that
* Run `dart ./dev/update_packages.dart` This will fetch all the Dart packages that
Flutter depends on. You can replicate what this script does by running
`pub get` in each directory that contains a `pubspec.yaml` file.
* Add this repository's `bin` directory to your path. That will let you use the
......
// 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.
import 'dart:io';
final String binaryName = Platform.isWindows ? 'pub.bat' : 'pub';
update(Directory directory) {
for (FileSystemEntity dir in directory.listSync()) {
if (dir is Directory) {
print("Updating ${dir.path}...");
Process.runSync(binaryName, ['get'], workingDirectory: dir.path);
}
}
}
main() {
String FLUTTER_ROOT = new File(Platform.script.toFilePath()).parent.parent.path;
update(new Directory("$FLUTTER_ROOT/packages"));
update(new Directory("$FLUTTER_ROOT/examples"));
}
#!/usr/bin/env 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.
import os
import subprocess
FLUTTER_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def update(directory):
packages = sorted(os.listdir(directory))
for package in packages:
package_dir = os.path.join(directory, package)
if os.path.isdir(package_dir):
print 'Updating', package, '...'
subprocess.check_call(['pub', 'get'], cwd=package_dir)
update(os.path.join(FLUTTER_ROOT, 'packages'))
update(os.path.join(FLUTTER_ROOT, 'examples'))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment