@nx/storybook
Version:
16 lines (15 loc) • 489 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateGitignore = updateGitignore;
function updateGitignore(tree) {
if (!tree.exists('.gitignore')) {
return;
}
const gitignore = tree.read('.gitignore', 'utf-8');
const regex = /storybook-static/gm;
const hasStorybookStatic = regex.test(gitignore ?? '');
if (hasStorybookStatic) {
return;
}
tree.write('.gitignore', `${gitignore}\n\nstorybook-static`);
}