Add CI for downloading emojis
This commit is contained in:
parent
66b2369476
commit
f31dc7d092
|
@ -0,0 +1,7 @@
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "8"
|
||||||
|
script:
|
||||||
|
- node update-emojis.js
|
||||||
|
after_success:
|
||||||
|
- bash push.sh
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
setup_git() {
|
||||||
|
git config --global user.email "travis@travis-ci.org"
|
||||||
|
git config --global user.name "Travis CI"
|
||||||
|
}
|
||||||
|
|
||||||
|
commit_git() {
|
||||||
|
git add --all
|
||||||
|
git commit -am "[ci skip] Travis build: $TRAVIS_BUILD_NUMBER"
|
||||||
|
}
|
||||||
|
|
||||||
|
push_git() {
|
||||||
|
git push https://${GH_TOKEN}@github.com/crimx/hexo-filter-github-emojis.git HEAD:master
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_git
|
||||||
|
commit_git
|
||||||
|
push_git
|
|
@ -16,7 +16,7 @@ request({
|
||||||
if (error || !_.isObject(json)) {
|
if (error || !_.isObject(json)) {
|
||||||
console.error('Failded to download Github emojis.')
|
console.error('Failded to download Github emojis.')
|
||||||
console.log(error, response, json)
|
console.log(error, response, json)
|
||||||
return
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const latestEmojis = Object.keys(json).reduce((emojis, name) => {
|
const latestEmojis = Object.keys(json).reduce((emojis, name) => {
|
||||||
|
@ -39,6 +39,7 @@ request({
|
||||||
function (err) {
|
function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.warn(err)
|
console.warn(err)
|
||||||
|
process.exit(1)
|
||||||
} else {
|
} else {
|
||||||
console.log(`Update ${Object.keys(emojis).length} emojis`)
|
console.log(`Update ${Object.keys(emojis).length} emojis`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue