Skip to content

Commit

Permalink
feat: sync command
Browse files Browse the repository at this point in the history
  • Loading branch information
gronxb committed Sep 14, 2024
1 parent 38e2770 commit c69c2f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/commands/sync.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { syncIcons } from "../utils/generateIcon";
import { loadConfig } from "../utils/config";

export const sync = async () => {
try {
const config = await loadConfig();
await syncIcons(config);
} catch (error) {
if (error instanceof Error) {
console.error(error.message);
} else {
console.error(error);
}
}
};
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { program } from "commander";
import pc from "picocolors";
import { init } from "./commands/init";
import { add } from "./commands/add";
import { sync } from "./commands/sync";

program.version(
[
Expand All @@ -25,4 +26,9 @@ program
.argument("<icon-name>", "The name of the icon to add")
.action(add);

program
.command("sync")
.description("Sync the icons to the project")
.action(sync);

program.parse();

0 comments on commit c69c2f8

Please sign in to comment.