Fix init bug

This commit is contained in:
Tobe O 2019-08-07 03:43:19 -04:00
parent efce4496fc
commit 63e5c99c96
3 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,7 @@
# 2.1.7+1
* Fix a bug where new directories were not being created in
`init`.
# 2.1.7 # 2.1.7
* Fix a bug where `ArgResults.arguments` was used in `init` instead of the * Fix a bug where `ArgResults.arguments` was used in `init` instead of the
intended `ArgResults.rest`. intended `ArgResults.rest`.

View file

@ -35,11 +35,12 @@ Future<void> copyDirectory(Directory source, Directory destination) async {
if (entity is Directory) { if (entity is Directory) {
var newDirectory = var newDirectory =
Directory(p.join(destination.absolute.path, p.basename(entity.path))); Directory(p.join(destination.absolute.path, p.basename(entity.path)));
await newDirectory.create(); await newDirectory.create(recursive: true);
await copyDirectory(entity.absolute, newDirectory); await copyDirectory(entity.absolute, newDirectory);
} else if (entity is File) { } else if (entity is File) {
var newPath = p.join(destination.path, p.basename(entity.path)); var newPath = p.join(destination.path, p.basename(entity.path));
// print(darkGray.wrap('\rCopying file "${entity.path}" -> "$newPath"')); // print(darkGray.wrap('\rCopying file "${entity.path}" -> "$newPath"'));
await File(newPath).create(recursive: true);
await entity.copy(newPath); await entity.copy(newPath);
} }
} }

View file

@ -2,7 +2,7 @@ author: Tobe O <thosakwe@gmail.com>
description: Command-line tools for the Angel framework, including scaffolding. description: Command-line tools for the Angel framework, including scaffolding.
homepage: https://github.com/angel-dart/angel_cli homepage: https://github.com/angel-dart/angel_cli
name: angel_cli name: angel_cli
version: 2.1.7 version: 2.1.7+1
dependencies: dependencies:
analyzer: ">=0.32.0 <2.0.0" analyzer: ">=0.32.0 <2.0.0"
args: ^1.0.0 args: ^1.0.0