@@ -74,13 +74,12 @@ Future<bool> docgen(List<String> files, {String packageRoot,
74
74
}
75
75
76
76
if (packageRoot == null && ! parseSdk) {
77
- // TODO(janicejl): At the moment, if a single file is passed it, it is
78
- // assumed that it does not have a package root unless it is passed in by
79
- // the user. In future, find a better way to find the packageRoot and also
80
- // fully test finding the packageRoot.
81
- if (FileSystemEntity .typeSync (files.first)
82
- == FileSystemEntityType .DIRECTORY ) {
77
+ var type = FileSystemEntity .typeSync (files.first);
78
+ if (type == FileSystemEntityType .DIRECTORY ) {
83
79
packageRoot = _findPackageRoot (files.first);
80
+ } else if (type == FileSystemEntityType .FILE ) {
81
+ logger.warning ('WARNING: No package root defined. If Docgen fails, try '
82
+ 'again by setting the --package-root option.' );
84
83
}
85
84
}
86
85
logger.info ('Package Root: ${packageRoot }' );
@@ -102,9 +101,6 @@ Future<bool> docgen(List<String> files, {String packageRoot,
102
101
}
103
102
104
103
List <String > _listLibraries (List <String > args) {
105
- // TODO(janicejl): At the moment, only have support to have either one file,
106
- // or one directory. This is because there can only be one package directory
107
- // since only one docgen is created per run.
108
104
if (args.length != 1 ) throw new UnsupportedError (USAGE );
109
105
var libraries = new List <String >();
110
106
var type = FileSystemEntity .typeSync (args[0 ]);
0 commit comments