1
0
mirror of https://gitlab.com/JKANetwork/jka-toolkit.git synced 2026-02-26 06:53:48 +01:00

Merge branch 'development'

This commit is contained in:
JoseluCross
2016-09-16 11:45:14 +02:00
3 changed files with 131 additions and 126 deletions

BIN
jka-toolkit/.gitdit.swp Normal file

Binary file not shown.

View File

@@ -2,11 +2,11 @@
# gitdit, a dialog interface to manage git repositories
# Author: JKA Network - contacto@jkanetwork.com
VERSION="1.0.2"
VERSION="1.0.3"
#First check if the user is in a git repository
preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ")
if [ $preOption = "Not" ];then #When it isn't only it can do git clone
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo repo (Hacer clone)" i "Inicializar nuevo repo"`
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface $VERSION" 0 0 6 c "Descargar un nuevo repo (Hacer clone)" i "Inicializar nuevo repo"`
else #Else, all other options
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" n "Crear nueva rama" b "Cambiar de rama " m "Unir ramas (Hacer merge)"`
actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch
@@ -18,12 +18,17 @@ if [ ! -z $gitopt ];then #No canceled
"i")
gitdir=`dialog --stdout --inputbox "Directorio del repositorio" 10 60 "."`
if [ $(echo $gitdir | cut -f1 -d"/") = "~" ];then #~ don't understand like $HOME
cant=$(echo $gitdir | grep -o "/" | wc -l)
gitdirdef="$HOME"
for (( i=2; i<=$cant; i++ ))
do
gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")"
done
elif [ $(echo $gitdit | cut -f1 -d"/") = "." ];then
gitdirdef=$(pwd)
for (( i=1; i<=$cant; i++ ))
do
gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")"
done
fi
if [ ! -d $gitdir ];then
mkdir -p $gitdirdef

View File

@@ -39,7 +39,7 @@ function msg2() {
echo
}
version="2.3.0"
version="2.3.1"
if [ -z "$1" ];then
echo "$(gettext "No option specified, use jkazip -h")" > /dev/stderr
elif [ "$1" = "-h" ];then
@@ -122,7 +122,7 @@ elif [ "$1" = "-c" ];then
### Funcion nueva
for compfile in "$@"; do
if [[ "$compfile" != "$1" && "$compfile" != "$2" ]];then
if [ ! -d "$compfile" -a ! -f "$compfile" ];then
if [[ ! -d "$compfile" && ! -f "$compfile" ]];then
printf -- "$(gettext "%s no such file or directory")" "$compfile"
echo
#exit
@@ -154,7 +154,7 @@ elif [ "$1" = "-c" ];then
msg "$files" "$salida"
;;
"zip")
zip "$salida" $files
zip -r "$salida" $files
msg "$files" "$salida"
;;
"gz" | "lz")