sense-c
·148 words·1 min
sense-c #
Sense the directories around you, are they git repositories, what language, etc.
Languages #
🐍 sense-py || 🦀 sense-rs || 🐹 gosense || 🇨 sense-c
Why? #
Why so many langs? #
Because I write projects pretty regularly in all of these languages and want a consistent API and available library support for all of them.
API #
Git #
int has_git(char *path);
int is_local_git(char *path);
Language #
enum LANG get_lang(char *path);
Example #
int main() {
int lang = get_lang("./");
printf("%s\n", get_lang_name(lang));
int git = has_git("./");
if (git) {
printf("Is git!\n");
} else {
printf("Is not git.\n");
}
int local = is_local_git("./");
if (local) {
printf("Is local!\n");
} else {
printf("Is not local.\n");
}
return 0;
}
Supported langs #
- Python
- JavaScript
- Rust
- Java
- Go
- TypeScript
- C
- CPP
Contributing #
If you would like to add features or language support, that would be amazing!