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:
parent
0cc7e3cb7c
commit
3f302dbde2
@ -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:
|
||||||
|
13
README.md
13
README.md
@ -1,13 +0,0 @@
|
|||||||
# emoji-cheat-sheet-generator
|
|
||||||
|
|
||||||
Setup
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
Generate Cheat Sheet
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm run generate
|
|
||||||
```
|
|
@ -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
11
scripts/generate.ts
Normal 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');
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user