Skip to content

Commit fe96ba0

Browse files
Merge pull request #448 from nodejs/doctoc-check
Refactor .travis.yml and add doctoc check
2 parents 752fb8a + 876f13a commit fe96ba0

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

.travis.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,30 @@ sudo: required
33
services:
44
- docker
55

6-
addons:
7-
apt:
8-
sources:
9-
- debian-sid
10-
packages:
11-
- shellcheck
12-
136
script:
14-
- shellcheck *.sh
15-
- ./test-build.sh $NODE_VERSION
7+
- if [ "true" = "${SHELLCHECK-}" ]; then shellcheck *.sh ; fi
8+
- if [ -n "${NODE_VERSION-}" ]; then ./test-build.sh $NODE_VERSION ; fi
9+
- if [ "true" = "${DOCTOCCHECK-}" ]; then
10+
nvm install node &&
11+
npm i -g doctoc &&
12+
cp README.md README.md.tmp &&
13+
doctoc --title='## Table of Contents' --github README.md &&
14+
diff -q README.md README.md.tmp;
15+
fi
1616

1717
env:
18-
matrix :
19-
- NODE_VERSION: '4.8'
20-
- NODE_VERSION: '6.11'
21-
- NODE_VERSION: '7.10'
22-
- NODE_VERSION: '8.1'
18+
- DOCTOCCHECK: true
19+
- NODE_VERSION: '4.8'
20+
- NODE_VERSION: '6.11'
21+
- NODE_VERSION: '7.10'
22+
- NODE_VERSION: '8.1'
23+
24+
matrix:
25+
include:
26+
env: SHELLCHECK=true
27+
addons:
28+
apt:
29+
sources:
30+
- debian-sid
31+
packages:
32+
- shellcheck

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
The official Node.js docker image, made with love by the node community.
99

10+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
11+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1012
## Table of Contents
1113

1214
- [What is Node.js?](#what-is-nodejs)
@@ -30,6 +32,8 @@ The official Node.js docker image, made with love by the node community.
3032
- [Docker Working Group Members](#docker-working-group-members)
3133
- [Docker Working Group Collaborators](#docker-working-group-collaborators)
3234

35+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
36+
3337
## What is Node.js?
3438

3539
Node.js is a platform built on Chrome's JavaScript runtime for easily building

0 commit comments

Comments
 (0)