pubspec 0.1.5 copy "pubspec: ^0.1.5" to clipboard
pubspec: ^0.1.5 copied to clipboard

outdated

A library for manipulating [pubspec](https://www.dartlang.org/tools/pub/pubspec.html) files

example/pubspec.dart

// 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);
}
17
likes
40
pub points
99%
popularity

Publisher

verified publishertheconduit.dev

A library for manipulating [pubspec](https://www.dartlang.org/tools/pub/pubspec.html) files

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

path, pub_semver, uri, yaml

More

Packages that depend on pubspec