1
0
mirror of https://github.com/ikatyang/emoji-cheat-sheet.git synced 2024-11-22 18:33:50 +01:00

chore(travis): set cron event

This commit is contained in:
ikatyang 2017-07-15 23:55:45 +08:00
parent 0cc7e3cb7c
commit 3f302dbde2
4 changed files with 16 additions and 14 deletions

View File

@ -7,6 +7,9 @@ script:
- yarn run lint - yarn run lint
- yarn run test -- --verbose --coverage - yarn run test -- --verbose --coverage
after_success:
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then yarn run generate; fi
cache: cache:
yarn: true yarn: true
directories: directories:

View File

@ -1,13 +0,0 @@
# emoji-cheat-sheet-generator
Setup
```sh
npm install
```
Generate Cheat Sheet
```sh
npm run generate
```

View File

@ -8,7 +8,8 @@
"repository": "https://github.com/ikatyang/emoji-cheat-sheet/tree/generator", "repository": "https://github.com/ikatyang/emoji-cheat-sheet/tree/generator",
"scripts": { "scripts": {
"lint": "tslint -p ./tsconfig.json", "lint": "tslint -p ./tsconfig.json",
"test": "jest -c ./jest.json" "test": "jest -c ./jest.json",
"generate": "ts-node ./scripts/generate.ts ./README.md"
}, },
"dependencies": { "dependencies": {
"cheerio": "^0.22.0", "cheerio": "^0.22.0",

11
scripts/generate.ts Normal file
View File

@ -0,0 +1,11 @@
import * as fs from 'fs';
import {create_cheat_sheet} from '../src/create-cheat-sheet';
const output_filename = process.argv[2];
if (output_filename === undefined) {
throw new Error(`Usage ts-node path/to/generate.ts path/to/output.md`);
}
create_cheat_sheet().then(cheat_sheet => {
fs.writeFileSync(output_filename, cheat_sheet, 'utf8');
});