Skip to content
Snippets Groups Projects
Commit 5e1a88db authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Corrigido install.sh

Verificação de string vazia estava checando um parmetro inexistente

(os problemas do ctrl+c e ctrl+v do stackoverflow)
parent 27a99950
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,8 @@ function install { ...@@ -24,6 +24,8 @@ function install {
function fresh-install { function fresh-install {
update update
install install
sudo apt-get install -y $PACKAGES
ruby
} }
function list { function list {
...@@ -44,19 +46,20 @@ function help { ...@@ -44,19 +46,20 @@ function help {
#Se o arquivo não existe, o script cria #Se o arquivo não existe, o script cria
if [ ! -f "$ABSOLUTE_PATH/packages.txt" ] if [ ! -f "$ABSOLUTE_PATH/packages.txt" ]
then then
packages="ssh:openssh-client openssh-server packages="ssh:openssh-client openssh-server\n"
php:php5 php5-mysql php5-pgsql php5-sqlite packages="${packages}php:php5 php5-mysql php5-pgsql php5-sqlite\n"
mysql:mysql-client mysql-server packages="${packages}mysql:mysql-client mysql-server\n"
nodejs:nodejs npm packages="${packages}nodejs:nodejs npm\n"
git:git packages="${packages}git:git\n"
editors:vim gedit packages="${packages}editors:vim gedit\n"
openjdk:openjdk-7-jre openjdk-7-jdk default-jdk default-jre packages="${packages}openjdk:openjdk-7-jre openjdk-7-jdk default-jdk default-jre\n"
flash:pepperflashplugin-nonfree packages="${packages}flash:pepperflashplugin-nonfree\n"
xchm:xchm packages="${packages}xchm:xchm\n"
latex:texlive-full kile packages="${packages}latex:texlive-full kile\n"
curl:curl packages="${packages}curl:curl\n"
make:make" packages="${packages}make:make\n"
echo $packages > "$ABSOLUTE_PATH/packages.txt"
echo -e $packages > "$ABSOLUTE_PATH/packages.txt"
fi fi
while [[ $# > 0 ]] while [[ $# > 0 ]]
do do
...@@ -64,7 +67,6 @@ do ...@@ -64,7 +67,6 @@ do
case $key in case $key in
-f|--fresh-install) -f|--fresh-install)
fresh-install fresh-install
sudo apt-get install -y $PACKAGES
exit 0 exit 0
;; ;;
-h|--help) -h|--help)
...@@ -85,10 +87,10 @@ do ...@@ -85,10 +87,10 @@ do
esac esac
shift shift
done done
if [ -z "${param// }" ] #Checa se a string não está vazia
if [ ! -z "${PACKAGES// }" ]
then then
# sudo apt-get install -y $PACKAGES sudo apt-get install -y $PACKAGES
echo $PACKAGES
else else
help help
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment