Skip to content

Instantly share code, notes, and snippets.

@shawe
Last active August 29, 2015 14:14
Show Gist options
  • Save shawe/e65a36242dce204d5432 to your computer and use it in GitHub Desktop.
Save shawe/e65a36242dce204d5432 to your computer and use it in GitHub Desktop.
Descargar el código de FS2015 y los plugins
#!/bin/bash
# Descarga el código de FS_2015 y los plugins disponibles
# Última actualización 16/02/2015
set -e
USER_HOME=`echo $HOME`
PATH_BASE="${USER_HOME}/Code"
if [ ! -d "${PATH_BASE}" ]; then
mkdir -p ${PATH_BASE}
echo -e "ATENCION: Parece que es la primera vez que utilizas este script\n"
echo -e "Antes de continuar necesitas tener una cuenta en:\n"
echo -e " - http://github.com\n"
echo -e " - http://gitlab.com\n"
echo -e "Una vez tengas las cuentas creadas deberás añadir tu clave SSH desde:\n"
echo -e " - https://github.com/settings/ssh\n"
echo -e " - https://gitlab.com/profile/keys\n"
echo -e "Una vez hayas realizado estos pasos, re-ejecuta el script.\n"
echo -e "Si no has introducido tus claves SSH o no tienes permisos suficientes\n"
echo -e "algunos repositorios darán error de acceso.\n"
echo -e "Puedes obtener ayuda en el siguiente enlace:\n"
echo -e "https://docs.google.com/document/d/1TS75O1DXdiBavwIHZ6xpExGAyTTllsFl9vasXYn79H4/edit?usp=sharing\n"
fi
cd ${PATH_BASE}
directories=( "FS_2015"
"plugins/facturacion_base"
"plugins/login_anonimo"
"plugins/megafacturador"
"plugins/modelo_347"
"plugins/SAT"
"plugins/xml_import_export"
"plugins/supermercado_solidario"
"plugins/documentos_facturas"
"plugins/factura_detallada"
"plugins/community3"
"plugins/perfil_usuario"
"plugins/backups"
"plugins/dashboard"
"plugins/presupuestos_y_pedidos"
"plugins/presupuestos_y_pedidos_compras"
"plugins/automocion"
"plugins/recibos_para_pagos_y_cobros"
"plugins/b2b"
"plugins/importador_datos"
"plugins/informes_y_charts"
"plugins/agenda"
"plugins/diarios"
"plugins/creditos"
)
git_path=( "https://github.com/NeoRazorX/facturascripts_2015.git"
"https://github.com/NeoRazorX/facturacion_base.git"
"https://github.com/NeoRazorX/login_anonimo.git"
"https://github.com/NeoRazorX/megafacturador.git"
"https://github.com/NeoRazorX/modelo_347.git"
"https://github.com/NeoRazorX/SAT.git"
"https://github.com/NeoRazorX/xml_import_export.git"
"https://github.com/NeoRazorX/supermercado_solidario.git"
"https://github.com/NeoRazorX/documentos_facturas.git"
"https://github.com/NeoRazorX/factura_detallada.git"
"https://github.com/NeoRazorX/community3.git"
"https://github.com/karl0zrodriguez/perfil_usuario.git"
"https://github.com/shawe/backups.git"
"https://github.com/shawe/dashboard.git"
"https://github.com/shawe/presupuestos_y_pedidos.git"
"https://github.com/shawe/presupuestos_y_pedidos_compras.git"
"[email protected]:shawe/facturascripts-plugins-automocion.git"
"[email protected]:shawe/facturascripts-plugins-recibos_para_pagos_y_cobros.git"
"[email protected]:shawe/facturascripts-plugin-b2b.git"
"[email protected]:shawe/facturascripts-plugin-importador-datos.git"
"[email protected]:shawe/facturascripts-plugins-informes_y_charts.git"
"[email protected]:salvaweb-co/agenda.git"
"[email protected]:salvaweb-co/diarios.git"
"[email protected]:salvaweb-co/creditos.git"
)
i=0
for dir in "${directories[@]}"
do
PATH_DIR="${PATH_BASE}/${dir}"
if [ -d "${PATH_DIR}" ]; then
echo -e "Updating git repository...\n"
cd "${PATH_DIR}"
unset GIT_DIR
Cmd="git pull -u origin master"
CmdRun=$($Cmd)
echo -e "Path: $PATH_DIR"
echo -e "Ejecutando: $ $Cmd\n"
echo -e "${CmdRun}\n"
elif [ ! -d "${PATH_DIR}" ]; then
echo -e "Clonning git repository...\n"
unset GIT_DIR
Cmd="git clone ${git_path[$i]} ${PATH_DIR}"
CmdRun=$($Cmd)
echo -e "Path: $PATH_DIR"
echo -e "Ejecutando: $ $Cmd\n"
echo -e "${CmdRun}\n"
fi
i=$((i+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment