update the sky_tools template and readme
This commit is contained in:
@@ -20,11 +20,11 @@ dependencies:
|
||||
## Running sky_tools
|
||||
|
||||
Run `sky_tools` (or `pub global run sky_tools`) to see a list of available
|
||||
commands.
|
||||
commands:
|
||||
|
||||
- *init*: create a new project
|
||||
- `init` to create a new project
|
||||
|
||||
Then run a sky_tools command, like `init`:
|
||||
Then, run a `sky_tools` command:
|
||||
|
||||
sky_tools init --out my_sky_project
|
||||
|
||||
|
||||
@@ -21,7 +21,14 @@ void main(List<String> args) {
|
||||
parser.addCommand(handler.name, handler.parser);
|
||||
handlers[handler.name] = handler;
|
||||
|
||||
ArgResults results = parser.parse(args);
|
||||
ArgResults results;
|
||||
|
||||
try {
|
||||
results = parser.parse(args);
|
||||
} catch (e) {
|
||||
_printUsage(parser, handlers, e is FormatException ? e.message : '${e}');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (results['help']) {
|
||||
_printUsage(parser, handlers);
|
||||
|
||||
@@ -45,9 +45,16 @@ class InitCommandHandler extends CommandHandler {
|
||||
|
||||
print('');
|
||||
|
||||
String message = 'All done! To run your application:\n'
|
||||
'cd ${out.path}\n'
|
||||
'./packages/sky/sky_tool start';
|
||||
String message = '''All done! To run your application:
|
||||
|
||||
cd ${out.path}
|
||||
./packages/sky/sky_tool start
|
||||
|
||||
Or if the Sky APK is not already on your device, run:
|
||||
|
||||
./packages/sky/sky_tool start --install
|
||||
|
||||
''';
|
||||
|
||||
if (results['pub']) {
|
||||
print("Running pub get...");
|
||||
@@ -128,8 +135,8 @@ const _readme = r'''
|
||||
|
||||
## Getting Started
|
||||
|
||||
For help getting started, view our online
|
||||
[readme](https://github.com/domokit/sky_engine/blob/master/sky/packages/sky/README.md).
|
||||
For help getting started with Sky, view our online
|
||||
[documentation](https://github.com/domokit/sky_engine/blob/master/sky/packages/sky/README.md).
|
||||
''';
|
||||
|
||||
const _pubspec = r'''
|
||||
@@ -137,23 +144,20 @@ name: {{projectName}}
|
||||
description: {{description}}
|
||||
dependencies:
|
||||
sky: any
|
||||
sky_tools: any
|
||||
''';
|
||||
|
||||
const _libMain = r'''
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
void main() => runApp(new HelloWorldApp());
|
||||
|
||||
class HelloWorldApp extends App {
|
||||
Widget build() {
|
||||
return new Scaffold(
|
||||
toolbar: new ToolBar(center: new Text("Demo")),
|
||||
toolbar: new ToolBar(center: new Text("Sky Demo")),
|
||||
body: new Material(child: new Center(child: new Text("Hello world!"))),
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
child: new Icon(type: 'content/add', size: 24)));
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
runApp(new HelloWorldApp());
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -32,9 +32,9 @@ defineTests() {
|
||||
results.values['out'] = temp.path;
|
||||
await handler.processArgResults(results);
|
||||
String path = p.join(temp.path, 'lib/main.dart');
|
||||
print(path);
|
||||
expect(new File(path).existsSync(), true);
|
||||
ProcessResult exec = Process.runSync('dartanalyzer', [path],
|
||||
ProcessResult exec = Process.runSync(
|
||||
'dartanalyzer', ['--fatal-warnings', path],
|
||||
workingDirectory: temp.path);
|
||||
expect(exec.exitCode, 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user