summaryrefslogtreecommitdiff
path: root/std/prettier/main.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-12-30 14:57:17 +0100
committerGitHub <noreply@github.com>2019-12-30 14:57:17 +0100
commit46d76a7562025374600a7f866dfc68c1b7e268e9 (patch)
tree0681d383781d8a28ac7ea23d75f22b1faeea0208 /std/prettier/main.ts
parentdf1665a8fc92168c3eb115a768ecfeccbe575e18 (diff)
upgrade: Tokio 0.2 (#3418)
Diffstat (limited to 'std/prettier/main.ts')
-rwxr-xr-xstd/prettier/main.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/std/prettier/main.ts b/std/prettier/main.ts
index b3c469659..163e0e45f 100755
--- a/std/prettier/main.ts
+++ b/std/prettier/main.ts
@@ -272,11 +272,17 @@ async function formatSourceFiles(
for await (const { filename } of files) {
const parser = selectParser(filename);
if (parser) {
- formats.push(formatFile(filename, parser, prettierOpts));
+ if (prettierOpts.write) {
+ formats.push(formatFile(filename, parser, prettierOpts));
+ } else {
+ await formatFile(filename, parser, prettierOpts);
+ }
}
}
- await Promise.all(formats);
+ if (prettierOpts.write) {
+ await Promise.all(formats);
+ }
exit(0);
}