Skip to content

Commit a97e808

Browse files
authored
docs(readme): specify environment in code blocks (#781)
* docs(readme): specify environment in code blocks This enables formatting to be present in `readme.md` for code blocks * Update README.md
1 parent 4620006 commit a97e808

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

Diff for: README.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ or greater.
1414

1515
Installation is as simple as running the following command (if you see `EACCES` error, reading [fixing npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions) may help):
1616

17-
```
17+
```sh
1818
npm install -g commitizen
1919
```
2020

@@ -26,7 +26,7 @@ Simply use `git cz` or just `cz` instead of `git commit` when committing. You ca
2626

2727
_Alternatively_, if you are using **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) instead of installing globally:
2828

29-
```
29+
```sh
3030
npx cz
3131
```
3232

@@ -53,19 +53,19 @@ For this example, we'll be setting up our repo to use [AngularJS's commit messag
5353

5454
First, install the Commitizen cli tools:
5555

56-
```
56+
```sh
5757
npm install commitizen -g
5858
```
5959

6060
Next, initialize your project to use the cz-conventional-changelog adapter by typing:
6161

62-
```
62+
```sh
6363
commitizen init cz-conventional-changelog --save-dev --save-exact
6464
```
6565

6666
Or if you are using Yarn:
6767

68-
```
68+
```sh
6969
commitizen init cz-conventional-changelog --yarn --dev --exact
7070
```
7171

@@ -150,7 +150,7 @@ Once either of these methods is implemented, users running `git commit` will be
150150

151151
Update `.git/hooks/prepare-commit-msg` with the following code:
152152

153-
```
153+
```sh
154154
#!/bin/bash
155155
exec < /dev/tty && node_modules/.bin/cz --hook || true
156156
```
@@ -159,7 +159,7 @@ exec < /dev/tty && node_modules/.bin/cz --hook || true
159159

160160
For `husky` users, add the following configuration to the project's `package.json`:
161161

162-
```
162+
```json
163163
"husky": {
164164
"hooks": {
165165
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
@@ -187,19 +187,19 @@ It may also make sense to change your README.md or CONTRIBUTING.md to include or
187187

188188
Install `commitizen` globally, if you have not already.
189189

190-
```
190+
```sh
191191
npm install -g commitizen
192192
```
193193

194194
Install your preferred `commitizen` adapter globally, for example [`cz-conventional-changelog`](https://www.npmjs.com/package/cz-conventional-changelog)
195195

196-
```
196+
```sh
197197
npm install -g cz-conventional-changelog
198198
```
199199

200200
Create a `.czrc` file in your `home` directory, with `path` referring to the preferred, globally installed, `commitizen` adapter
201201

202-
```
202+
```sh
203203
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
204204
```
205205

@@ -218,7 +218,7 @@ format for all of them. You can create your own node module which acts as front-
218218

219219
### 1. Create your own entry point script
220220

221-
```
221+
```js
222222
// my-cli.js
223223

224224
#!/usr/bin/env node
@@ -238,7 +238,7 @@ bootstrap({
238238

239239
### 2. Add script to package.json
240240

241-
```
241+
```json
242242
// package.json
243243

244244
{
@@ -253,8 +253,9 @@ bootstrap({
253253

254254
### 3. Publish it to npm and use it!
255255

256-
```
257-
npm install company-commit --save-dev
256+
```sh
257+
npm install --save-dev company-commit
258+
258259
./node_modules/.bin/company-commit
259260
```
260261

0 commit comments

Comments
 (0)