Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: turn into npx package #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

omar2205
Copy link

This adds a CLI to be used as npx @primeagen/kata
image

  • Note: This needs the modified generate script:
- const config = require("../ligma.config");
+ const config = JSON.parse(fs.readFileSync("./ligma.config.json", "utf-8"));

Usage

  1. Run npm run build to generate dist/index.js
  2. Run node dist/index.js, creating a kata folder with the selected dsa.

@ThePrimeagen
Copy link
Owner

@1Marc you fine with these changes? I am. could make it easier, but would require the team to put a small note in the pressy

@ThePrimeagen
Copy link
Owner

@omar2205 could we also get an update in the readme on how to use this?

@omar2205
Copy link
Author

Would these do?

Getting Started

  1. Run npx @primeagen/kata
  2. Select which DSA you would like to try to solve. (Follow instructions)
  3. Run cd kata

If you want to try other DSA, you can run npx @primeagen/kata inside your kata directory, which will generate a new day in the src directory.

scripts/generate Outdated
@@ -1,7 +1,7 @@
#!/usr/bin/env node
const fs = require("fs");
const path = require("path");
const config = require("../ligma.config");
const config = JSON.parse(fs.readFileSync("./ligma.config.json", "utf-8"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path!

there is the / in there, i think there is another issue right now via windows

Copy link
Author

@omar2205 omar2205 Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, fs stuff handle it correctly
image

  • just got this notification, thx github

@ThePrimeagen
Copy link
Owner

ok, i am ready to get this is @omar2205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants