From 6e2030fdf439b24865c88f8cd272bf6ba915c5da Mon Sep 17 00:00:00 2001 From: thosakwe Date: Sat, 31 Dec 2016 13:19:51 -0500 Subject: [PATCH] 17 --- lib/src/commands/init.dart | 7 +++++-- lib/src/commands/key.dart | 5 ++++- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/src/commands/init.dart b/lib/src/commands/init.dart index 73fb543..fede5e2 100644 --- a/lib/src/commands/init.dart +++ b/lib/src/commands/init.dart @@ -30,10 +30,13 @@ class InitCommand extends Command { await _pubGet(projectDir); await preBuild(projectDir); var secret = rs.randomAlphaNumeric(32); - print('Generated new JWT secret: $secret'); + print('Generated new development JWT secret: $secret'); await _key.changeSecret( new File.fromUri(projectDir.uri.resolve('config/default.yaml')), secret); + + secret = rs.randomAlphaNumeric(32); + print('Generated new production JWT secret: $secret'); await _key.changeSecret( new File.fromUri(projectDir.uri.resolve('config/production.yaml')), secret); @@ -91,7 +94,7 @@ class InitCommand extends Command { preBuild(Directory projectDir) async { // Run build print('Pre-building resources...'); - + var build = await Process.start(Platform.executable, ['tool/build.dart'], workingDirectory: projectDir.absolute.path); diff --git a/lib/src/commands/key.dart b/lib/src/commands/key.dart index 93fff9f..56b922d 100644 --- a/lib/src/commands/key.dart +++ b/lib/src/commands/key.dart @@ -12,8 +12,11 @@ class KeyCommand extends Command { @override run() async { var secret = rs.randomAlphaNumeric(32); - print('Generated new JWT secret: $secret'); + print('Generated new development JWT secret: $secret'); await changeSecret(new File('config/default.yaml'), secret); + + secret = rs.randomAlphaNumeric(32); + print('Generated new production JWT secret: $secret'); await changeSecret(new File('config/production.yaml'), secret); } diff --git a/pubspec.yaml b/pubspec.yaml index cac7195..fc31d27 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_cli -version: 1.0.0-dev+16 +version: 1.0.0-dev+17 description: Command-line tools for the Angel framework. environment: sdk: ">=1.19.0"