-
Notifications
You must be signed in to change notification settings - Fork 0
Testing Add Snippet Feature #1
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
base: main
Are you sure you want to change the base?
Conversation
Added its required fields in index.js. Does work in cli but does not take input yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for now for the add snippet one. Now make the similar structure for delete snippet, edit, list, and view snippets.Think about the required details that the user would need to input and create the similar configuration
index.js
Outdated
.option('-l,--lang<language>','specify the programming language') | ||
.option('-d,--desc<description>','describe the code snippet') | ||
.option('-f,--file<path>','Path to the file containting the snippet') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling: containing instead of containting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the options which are compulsory, such as path to file containing snippet, lang, maybe description, consider making them requiredOptions or similar so that if they aren't given the program will throw an error.
tested for bugs
Added new file 'snippet.json' to store the Snippets
…mented out). also storing snippets locally in snippet.json
…ags and any specific keywords
…us search function for now)
# server with the `prisma dev` CLI command, when not choosing any non-default ports or settings. The API key, unlike the | ||
# one found in a remote Prisma Postgres URL, does not contain any sensitive information. | ||
|
||
DATABASE_URL="postgresql://postgres.wgxbziqzoxkhmhvrqaee:[email protected]:5432/postgres" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bruh
console.error("❌ Provided file does not exist."); | ||
process.exit(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using throw
console.log(`\n${i + 1}. ${s.name} [${s.lang}]`); | ||
console.log(`📄 ${s.desc}`); | ||
console.log(`📁 ${s.file}`); | ||
console.log(`🏷️ ${s.tags?.join(", ")}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use multiline log instead
console.log(`\n📌 Name: ${snippet.name}`); | ||
console.log(`🖋️ Language: ${snippet.lang}`); | ||
console.log(`📝 Description: ${snippet.desc}`); | ||
console.log(`📁 File: ${snippet.file}`); | ||
console.log(`🏷️ Tags: ${snippet.tags?.join(", ")}`); | ||
console.log(`\n📄 Code:\n${snippet.code}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
commit message
Added "add snippet" feature.
Added its required fields in index.js.
Does work in cli but does not take input yet.