|
1 |
| -import { Url } from '@basemaps/shared'; |
| 1 | +import { fsa, Url } from '@basemaps/shared'; |
2 | 2 | import { CliInfo } from '@basemaps/shared/build/cli/info.js';
|
3 | 3 | import { getLogger, logArguments } from '@basemaps/shared/build/cli/log.js';
|
4 | 4 | import { VectorTile } from '@mapbox/vector-tile';
|
5 | 5 | import bs3 from 'better-sqlite3';
|
6 | 6 | import { command, option, restPositionals } from 'cmd-ts';
|
7 |
| -import { readFileSync, writeFileSync } from 'fs'; |
| 7 | +import { readFileSync } from 'fs'; |
8 | 8 | import Mustache from 'mustache';
|
9 | 9 | import sizeof from 'object-sizeof';
|
10 | 10 | import Protobuf from 'pbf';
|
@@ -65,8 +65,7 @@ export const AnalyseArgs = {
|
65 | 65 | }),
|
66 | 66 | target: option({
|
67 | 67 | long: 'target',
|
68 |
| - defaultValue: () => 'packages/cli-vector/analysis/result.md', |
69 |
| - defaultValueIsSerializable: true, |
| 68 | + type: Url, |
70 | 69 | description: 'Target location for the result file',
|
71 | 70 | }),
|
72 | 71 | };
|
@@ -169,6 +168,6 @@ export const AnalyseCommand = command({
|
169 | 168 |
|
170 | 169 | const template = readFileSync(args.template).toString();
|
171 | 170 | const output = Mustache.render(template, { data: analysisData });
|
172 |
| - writeFileSync(args.target, output); |
| 171 | + await fsa.write(args.target, fsa.readStream(fsa.toUrl(output))); |
173 | 172 | },
|
174 | 173 | });
|
0 commit comments