I can not get stdin to work with `grind`
- Dominant language
- Dart
- Stars
- 266
- Forks
- 36
- Avg merge
- 23h 25m
- Merged PRs (30d)
- 2
Description
I have this task:
``` dart
#!/usr/bin/env dart
import 'package:git/git.dart';
import 'package:grinder/grinder.dart';
...
@Task()
Future createComponent() async {
await stdin
.map(SYSTEM_ENCODING.decode)
.map((s) => s.trim())
.forEach((component) async {
new File('lib/components/$component.scss')..createSync();
new File('lib/components/$component.html')..createSync();
new File('lib/components/$component.dart')
..createSync()
..writeAsStringSync('''
import 'package:angular2/core.dart';
@Component(
selector: '${component.replaceAll('_', '-')}',
templateUrl: '$component.html',
styleUrls: const ['$component.css']
)
class ${component.split('_').map((s) => s[0].toUpperCase() + s.substring(1)).join('')} {}
''');
await runGit(['add', '--all']);
});
}
```
For some reason this only works I have run the task like:
`tool/grind.dart create-component`
and not if I run it like:
`grind create-component`
Not sure if this is a `pub` bug or a grinder bug.
Contributor guide
Assessment
This issue has not been assessed yet.