Skip to content

Commit

Permalink
feat(utils): fix writeChecked implementation
Browse files Browse the repository at this point in the history
feat(full): add `sd start route` subcommand
  • Loading branch information
Tommypop2 committed Jan 23, 2025
1 parent b190a0e commit e50c871
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 19 additions & 2 deletions packages/full-solid/src/start/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import { createRoute } from "@solid-cli/utils";
import { defineCommand } from "citty";

export const startCommands = defineCommand({});
import * as p from "@clack/prompts";
export const startCommands = defineCommand({
meta: { description: "Start-specific commands" }, subCommands: {
route: defineCommand({
args: {
path: {
type: "positional",
required: false,
description: "Route name",
},
},
async run({ args: { path } }) {
await createRoute(path as string);
p.log.success(`Route ${path} successfully created!`)
},
})
}
});
4 changes: 2 additions & 2 deletions packages/utils/src/fs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const readFileToString = async (path: string) => {
// unqueueUpdate(path, "file");
// queueUpdate({ type: "file", name: path, contents, checked: true });
// };
export const writeChecked = async (_path: string, _contents: string) => {
throw new Error("Unimplemented");
export const writeChecked = async (path: string, contents: string) => {
await writeFile(path, contents);
};
export const insertAtBeginning = async (path: string, text: string) => {
const contents = await readFileToString(path);
Expand Down

0 comments on commit e50c871

Please sign in to comment.