myst-cli
Version:
Command line tools for MyST
24 lines (23 loc) • 552 B
JavaScript
import { makeExecutable } from 'myst-cli-utils';
import { fsExists } from './fsExists.js';
export async function checkFolderIsGit() {
try {
await makeExecutable('git status', null)();
return true;
}
catch (error) {
return false;
}
}
export async function checkIgnore(pattern) {
try {
await makeExecutable(`git check-ignore ${pattern}`, null)();
return true;
}
catch (error) {
return false;
}
}
export async function checkAtGitRoot() {
return await fsExists('.git');
}