Skip to content

Commit

Permalink
Default directory to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Dec 31, 2024
1 parent 937c4c3 commit 41873f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/create/src/cli/initialize/runModeInitialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export interface RunModeInitializeSettings {
directory?: string;
from?: string;
preset?: string;
repository?: string;
}

export async function runModeInitialize({
args,
directory: requestedDirectory,
repository,
directory: requestedDirectory = repository,
from = findPositionalFrom(args),
preset: requestedPreset,
}: RunModeInitializeSettings): Promise<ModeResults> {
Expand Down Expand Up @@ -118,7 +120,7 @@ export async function runModeInitialize({
chalk.blue("Your new repository is ready in:"),
chalk.green(directory.startsWith(".") ? directory : `./${directory}`),
].join(" "),
status: CLIStatus.Error,
status: CLIStatus.Success,
suggestions: creation.suggestions,
};
}
8 changes: 8 additions & 0 deletions packages/create/src/cli/runCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const valuesSchema = z.object({
directory: z.string().optional(),
from: z.string().optional(),
mode: z.union([z.literal("initialize"), z.literal("migrate")]).optional(),
owner: z.string().optional(),
preset: z.string().optional(),
repository: z.string().optional(),
});

export async function runCli(args: string[], logger: Logger) {
Expand All @@ -35,9 +37,15 @@ export async function runCli(args: string[], logger: Logger) {
mode: {
type: "string",
},
owner: {
type: "string",
},
preset: {
type: "string",
},
repository: {
type: "string",
},
version: {
type: "boolean",
},
Expand Down

0 comments on commit 41873f8

Please sign in to comment.