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

Show steps for initializing a new Git repo #1081

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion node-src/ui/messages/errors/gitNotInitialized.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export default {
title: 'CLI/Messages/Errors',
};

export const GitNotInitialized = () => gitNotInitialized({ command: 'git --version' });
export const GitNotInitialized = () =>
gitNotInitialized({ command: 'git --version' }).replaceAll('<', '&lt').replaceAll('>', '&gt');
12 changes: 12 additions & 0 deletions node-src/ui/messages/errors/gitNotInitialized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ import chalk from 'chalk';
import { dedent } from 'ts-dedent';

import { error } from '../../components/icons';
import link from '../../components/link';

export default ({ command }: { command: string }) =>
dedent(chalk`
${error} {bold Unable to execute command}: ${command}
Chromatic only works from inside a Git repository.

You can initialize a new Git repository with \`git init\`.

You will also need a single commit in order to run a build. To do that:

- Add a file (or multiple files) with \`git add <FILE_PATH(S)>\`
- Commit the file(s) with \`git commit --message="<MESSAGE>"\`

Once you've done so, please run this build again.

For more information on Git, feel free to check out the Pro Git book: ${link('https://git-scm.com/book/en/v2')}
`);
Loading