Permalink
Browse files

remove function keyword

  • Loading branch information...
1 parent 49ea8f1 commit 38e7627a5b3c94ca6bed3da27feb90f3d606582a @svenfuchs svenfuchs committed Dec 27, 2012
Showing with 7 additions and 7 deletions.
  1. +4 −4 lib/travis/build/script/templates/header.sh
  2. +3 −3 spec/support/header.sh
@@ -1,20 +1,20 @@
-function travis_start() {
+travis_start() {
echo "`date +%s.%N` [$1] start" >> <%= LOGS[:state] %>
}
-function travis_end() {
+travis_end() {
echo "`date +%s.%N` [$1] end, result: $?" >> <%= LOGS[:state] %>
}
-function travis_assert() {
+travis_assert() {
if [ $? != 0 ]; then
echo "Command did not exit with 0. Exiting." >> <%= LOGS[:build] %>
echo "`date +%s.%N` Command did not exit with 0. Exiting." >> <%= LOGS[:state] %>
kill $$
fi
}
-function travis_timeout() {
+travis_timeout() {
local pid=$!
local start=$(date +%s)
while ps aux | awk '{print $2 }' | grep -q $pid 2> /dev/null; do
View
@@ -1,7 +1,7 @@
mkdir -p tmp
cd tmp
-function travis_timeout() {
+travis_timeout() {
sleep 0 # no usleep
sleep 0
builtin echo travis_timeout $1 >> test.log
@@ -26,13 +26,13 @@ stubs=( \
sbt
)
for stub in ${stubs[*]}; do
- eval "function $stub() { builtin echo $stub \$@ >> test.log; builtin echo output from $stub \$@; }"
+ eval "$stub() { builtin echo $stub \$@ >> test.log; builtin echo output from $stub \$@; }"
done
stubs=( \
echo cd rm mkdir source \
travis_start travis_end travis_assert \
)
for stub in ${stubs[*]}; do
- eval "function $stub() { builtin echo $stub \$@ >> test.log; }"
+ eval "$stub() { builtin echo $stub \$@ >> test.log; }"
done

0 comments on commit 38e7627

Please sign in to comment.