pubspec 0.1.5 pubspec: ^0.1.5 copied to clipboard
A library for manipulating [pubspec](https://www.dartlang.org/tools/pub/pubspec.html) files
// Copyright (c) 2015, Anders Holmgren. 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';
import 'package:pubspec/pubspec.dart';
main() async {
// specify the directory
var myDirectory = new Directory('myDir');;
// load pubSpec
var pubSpec = await PubSpec.load(myDirectory);
// change the dependencies to a single path dependency on project 'foo'
var newPubSpec = pubSpec.copy(
dependencies: { 'foo': new PathReference('../foo')});
// save it
await newPubSpec.save(myDirectory);
}