Skip to content

Commit 988434e

Browse files
cli: skip prettier formatting if install dependency is skipped (#784)
1 parent 75267de commit 988434e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export async function createProject(options: Options) {
4848
{
4949
title: "🪄 Formatting files with prettier",
5050
task: () => prettierFormat(targetDirectory),
51+
skip: () => {
52+
if (!options.install) {
53+
return "Skipping because prettier install was skipped";
54+
}
55+
},
5156
},
5257
{
5358
title: `📡 Initializing Git repository ${

src/tasks/prettier-format.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { execa } from "execa";
22

3+
// TODO: Instead of using execa, use prettier package from cli to format targetDir
34
export async function prettierFormat(targetDir: string) {
45
try {
56
const result = await execa("yarn", ["format"], { cwd: targetDir });

0 commit comments

Comments
 (0)