39 lines
696 B
Bash
Executable File
39 lines
696 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
uninstall_hanami_gems() {
|
|
declare -a frameworks=(hanami hanami-assets hanami-mailer hanami-controller hanami-view hanami-model hanami-helpers hanami-router hanami-validations hanami-webconsole hanami-utils)
|
|
|
|
for framework in "${frameworks[@]}"
|
|
do
|
|
gem uninstall -ax --force $framework > /dev/null
|
|
done
|
|
}
|
|
|
|
bundle_install() {
|
|
bundle install > /dev/null
|
|
}
|
|
|
|
advertise_start() {
|
|
echo -en "Cleaning up.."
|
|
}
|
|
|
|
advertise_end() {
|
|
echo " done"
|
|
}
|
|
|
|
main() {
|
|
local ci=${CI:-false}
|
|
|
|
if [ "$ci" = true ] ; then
|
|
echo "Running on CI, skipping cleanup"
|
|
else
|
|
advertise_start &&
|
|
uninstall_hanami_gems &&
|
|
advertise_end
|
|
fi
|
|
}
|
|
|
|
main
|