File tree Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ dist : trusty
2
+ sudo : false
3
+
4
+ language : node_js
5
+
6
+ before_install :
7
+ - npm install -g luamin
8
+ - git checkout ./bin/travis-minify.sh
9
+ - git checkout ./bin/travis-test.sh
10
+ after_success :
11
+ - ./bin/travis-minify.sh
12
+ install :
13
+ - ./bin/travis-test.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ ${TRAVIS_PULL_REQUEST} == false ]; then
4
+ SHORT_HASH=` git rev-parse --short HEAD`
5
+ GITHUB_OWNER=` echo " ${TRAVIS_REPO_SLUG} " | cut -d " /" -f 1`
6
+ SUBJECT=` git log -n 1 --pretty=format:%s`
7
+ rm Makefile
8
+ git config --global user.email " travis@travis-ci.org"
9
+ git config --global user.name " Travis CI"
10
+ git remote rm origin
11
+ git remote add origin https://${GITHUB_OWNER} :${GITHUB_TOKEN} @github.com/${TRAVIS_REPO_SLUG} .git > /dev/null
12
+ git add .
13
+ git stash
14
+ git checkout ${TRAVIS_BRANCH}
15
+ git stash pop
16
+ git add .
17
+ git commit -am " Minified: ${SUBJECT} [${SHORT_HASH} ] [skip ci]"
18
+ git push --set-upstream origin ${TRAVIS_BRANCH}
19
+ echo " Done!"
20
+ else
21
+ echo " Pull requests are not minified...Exiting."
22
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " test: ;" > Makefile
4
+
5
+ if [ -d sdcard ]; then
6
+ rm -fR sdcard
7
+ fi
8
+
9
+ cp -fR src sdcard
10
+
11
+ MANIFEST=(` find sdcard/ -iname * .lua -type f` );
12
+ FAIL=0
13
+
14
+ chmod +x ./bin/travis-minify.sh
15
+
16
+ if [ ${# MANIFEST[@]} -eq 0 ]; then
17
+ echo -e " \e[1m\e[39m[\e[31mTEST FAILED\e[39m]\e[21m No scripts could be found!."
18
+ exit 1
19
+ fi
20
+
21
+ for f in ${MANIFEST[@]} ;
22
+ do
23
+ luamin -f $f > $f .mini
24
+ mv $f .mini $f
25
+ if [ ` cat $f | wc -l` -ne 1 ]; then
26
+ FAIL=1
27
+ echo -e " \e[1m\e[39m[\e[31mFAIL\e[39m]\e[21m ${f} "
28
+ cat $f
29
+ else
30
+ echo -e " \e[1m\e[39m[\e[32mPASS\e[39m]\e[21m ${f} "
31
+ fi
32
+ done
33
+
34
+ if [ $FAIL -ne 0 ]; then
35
+ echo -e " \e[1m\e[39m[\e[31mTEST FAILED\e[39m]\e[21m Please review your code and amend changes to the current branch."
36
+ exit 1
37
+ fi
38
+
You can’t perform that action at this time.
0 commit comments