Skip to content

Commit ee368ab

Browse files
committed
write report to aws
1 parent 720ae14 commit ee368ab

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/cli-vector/src/cli/cli.analyse.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Url } from '@basemaps/shared';
1+
import { fsa, Url } from '@basemaps/shared';
22
import { CliInfo } from '@basemaps/shared/build/cli/info.js';
33
import { getLogger, logArguments } from '@basemaps/shared/build/cli/log.js';
44
import { VectorTile } from '@mapbox/vector-tile';
55
import bs3 from 'better-sqlite3';
66
import { command, option, restPositionals } from 'cmd-ts';
7-
import { readFileSync, writeFileSync } from 'fs';
7+
import { readFileSync } from 'fs';
88
import Mustache from 'mustache';
99
import sizeof from 'object-sizeof';
1010
import Protobuf from 'pbf';
@@ -65,8 +65,7 @@ export const AnalyseArgs = {
6565
}),
6666
target: option({
6767
long: 'target',
68-
defaultValue: () => 'packages/cli-vector/analysis/result.md',
69-
defaultValueIsSerializable: true,
68+
type: Url,
7069
description: 'Target location for the result file',
7170
}),
7271
};
@@ -169,6 +168,6 @@ export const AnalyseCommand = command({
169168

170169
const template = readFileSync(args.template).toString();
171170
const output = Mustache.render(template, { data: analysisData });
172-
writeFileSync(args.target, output);
171+
await fsa.write(args.target, fsa.readStream(fsa.toUrl(output)));
173172
},
174173
});

0 commit comments

Comments
 (0)