Skip to content

Commit ad5458f

Browse files
committed
Add travis initialize callable
1 parent a11af6f commit ad5458f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

callable.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,26 @@ Test__callable_main() {
8787
return 1
8888
fi
8989
}
90+
91+
##################################################
92+
# This function will download the most recent
93+
# travis.yml file and set it in the current module.
94+
#
95+
# Fetches the most recent travis.yml file from:
96+
# https://github.com/ash-shell/travis-buildpack
97+
##################################################
98+
Test__callable_travis() {
99+
file_location=$Ash__CALL_DIRECTORY/travis.yml
100+
if [[ ! -f "$file_location" ]]; then
101+
Logger__alert "Downloading most recent Buildpack..."
102+
curl https://raw.githubusercontent.com/ash-shell/travis-buildpack/master/travis.yml > "$file_location"
103+
if [[ $? -eq 0 ]]; then
104+
Logger__success "travis.yml file is set up in the current directory!"
105+
else
106+
Logger__error "Failed to download the most recent Buildpack... Check your network and try again."
107+
rm "$file_location"
108+
fi
109+
else
110+
Logger__error "There is already a travis.yml file located in the current directory"
111+
fi
112+
}

0 commit comments

Comments
 (0)