mirror of
https://gitlab.com/JKANetwork/jka-toolkit.git
synced 2026-02-15 09:31:32 +01:00
Merge branch 'hotfix'
This commit is contained in:
@@ -1,31 +1,63 @@
|
||||
#!/bin/bash
|
||||
VERSION="0.1.1"
|
||||
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" s "Subir actualizaciones al git (Hacer push)" c "Descargar un nuevo git (Hacer clone)" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"`
|
||||
|
||||
VERSION="0.2.0"
|
||||
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)" c "Descargar un nuevo git (Hacer clone)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge a la rama actual)"`
|
||||
actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")"
|
||||
case $gitopt in
|
||||
"p") git pull;;
|
||||
"s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50`
|
||||
"p") git pull $actual;;
|
||||
"s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
commit="changes"
|
||||
fi
|
||||
git add . && git commit -m "$commit" && git push
|
||||
git add . && git commit -m "$commit" && git push $actual
|
||||
;;
|
||||
"c")
|
||||
giturl=`dialog --stdout --inputbox "URL del git" 10 60`
|
||||
git clone $giturl
|
||||
;;
|
||||
"t")
|
||||
commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
commit="changes"
|
||||
fi
|
||||
git add . && git commit -m "$commit"
|
||||
;;
|
||||
"b")
|
||||
gitbranch=`dialog --stdout --inputbox "Nueva rama/branch" 10 60`
|
||||
git checkout $gitbranch
|
||||
j=0
|
||||
rama=""
|
||||
for i in $(git branch --list | grep "^*" -v )
|
||||
do
|
||||
if [ $i != "*" ];then
|
||||
rama="$rama $j $i"
|
||||
lista[$j]=$i
|
||||
let j++
|
||||
fi
|
||||
done
|
||||
ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama`
|
||||
if [ ! -z $ramificacion ];then
|
||||
git checkout ${lista[$ramificacion]}
|
||||
fi
|
||||
;;
|
||||
"n")
|
||||
NewBranch=`dialog --stdout --inputbox "Nombre de la nueva rama" 10 50 "new branch"`
|
||||
if [ ! -z $NewBranch ];then
|
||||
git checkout -b $NewBranch
|
||||
fi
|
||||
;;
|
||||
"m")
|
||||
until [[ $gitbusing && $gitbmerge ]]
|
||||
j=0
|
||||
rama=""
|
||||
for i in $(git branch --list | grep "^*" -v )
|
||||
do
|
||||
gitbusing=`dialog --stdout --inputbox "Rama actual" 10 60`
|
||||
gitbmerge=`dialog --stdout --inputbox "Rama con la que unir (la final,normalmente master)" 10 60`
|
||||
if [ $i != "*" ];then
|
||||
rama="$rama $j $i"
|
||||
lista[$j]=$i
|
||||
let j++
|
||||
fi
|
||||
done
|
||||
git checkout $gitbmerge
|
||||
git merge $gitbusing
|
||||
git push
|
||||
merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir a $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama`
|
||||
if [ ! -z $merges ];then
|
||||
git merge ${lista[$merges]}
|
||||
git push
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
@@ -28,22 +28,22 @@ function sacaFormato() {
|
||||
}
|
||||
#Function msg, print in stdout a final message
|
||||
function msg() {
|
||||
local var=$1
|
||||
local var2=$2
|
||||
printf -- "$(gettext "File/s %s has/have been compressed in %s")" $var $var2
|
||||
local var="$1"
|
||||
local var2="$2"
|
||||
printf -- "$(gettext "File/s %s has/have been compressed in %s")" "$var" "$var2"
|
||||
echo
|
||||
}
|
||||
#Function msg2, print in stdout a final message
|
||||
function msg2() {
|
||||
local var=$1
|
||||
printf -- "$(gettext "File %s has been decompressed")" $var
|
||||
local var="$1"
|
||||
printf -- "$(gettext "File %s has been decompressed")" "$var"
|
||||
echo
|
||||
}
|
||||
|
||||
version="2.0.2"
|
||||
if [ -z $1 ];then
|
||||
version="2.0.3"
|
||||
if [ -z "$1" ];then
|
||||
echo "$(gettext "No option specified, use jkazip -h")" > /dev/stderr
|
||||
elif [ $1 = "-h" ];then
|
||||
elif [ "$1" = "-h" ];then
|
||||
echo "$(gettext " synopsis: jkazip <options> <file or directory>")"
|
||||
echo ""
|
||||
echo "$(gettext " -d, decompress file")"
|
||||
@@ -59,14 +59,14 @@ elif [ $1 = "-h" ];then
|
||||
echo ""
|
||||
echo "$(gettext " Supported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and zip")"
|
||||
echo ""
|
||||
elif [ $1 = "-v" ];then
|
||||
elif [ "$1" = "-v" ];then
|
||||
printf -- "$(gettext "jkazip by JKA Network; version %s")" "$version"
|
||||
echo
|
||||
elif [ $1 = "-d" ];then
|
||||
if [ -z $2 ];then
|
||||
elif [ "$1" = "-d" ];then
|
||||
if [ -z "$2" ];then
|
||||
echo "$(gettext "No file or directory specified")" > /dev/stderr
|
||||
exit
|
||||
elif [ -f $2 ];then
|
||||
elif [ -f "$2" ];then
|
||||
printf -- "$(gettext "File %s will be decompressed")" "$2"
|
||||
echo
|
||||
else
|
||||
@@ -74,37 +74,37 @@ elif [ $1 = "-d" ];then
|
||||
echo
|
||||
exit
|
||||
fi
|
||||
entrada=$2
|
||||
sacaFormato $entrada
|
||||
entrada="$2"
|
||||
sacaFormato "$entrada"
|
||||
case $formato in
|
||||
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz")
|
||||
tar xvf $entrada
|
||||
msg2 $entrada
|
||||
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz2" | "txz" | "tlz")
|
||||
tar xvf "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
"7z")
|
||||
7z x $entrada
|
||||
msg2 $entrada
|
||||
7z x "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
"zip")
|
||||
unzip $entrada
|
||||
msg2 $entrada
|
||||
unzip "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
"gz" | "lz")
|
||||
formato="${formato}ip"
|
||||
$formato -dk $entrada
|
||||
msg2 $entrada
|
||||
$formato -dk "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
"xz")
|
||||
$formato -dk $entrada
|
||||
msg2 $entrada
|
||||
$formato -dk "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
"bz2")
|
||||
bzip2 -dk $entrada
|
||||
msg2 $entrada
|
||||
bzip2 -dk "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
"rar")
|
||||
unrar x $entrada
|
||||
msg2 $entrada
|
||||
unrar x "$entrada"
|
||||
msg2 "$entrada"
|
||||
;;
|
||||
*)
|
||||
printf -- "$(gettext "File extension %s are not supported")" $formato > /dev/stderr
|
||||
@@ -112,54 +112,63 @@ elif [ $1 = "-d" ];then
|
||||
;;
|
||||
esac
|
||||
|
||||
elif [ $1 = "-c" ];then
|
||||
salida=$2
|
||||
if [ -z $3 ];then
|
||||
elif [ "$1" = "-c" ];then
|
||||
salida="$2"
|
||||
if [ -z "$3" ];then
|
||||
echo "$(gettext "No file or directory specified")"
|
||||
exit
|
||||
else
|
||||
for i in $@
|
||||
do
|
||||
if [[ $i != $1 && $i != $2 ]];then
|
||||
if [ ! -d $i -a ! -f $i ];then
|
||||
printf -- "$(gettext "%s no such file or directory")" "$i"
|
||||
echo
|
||||
exit
|
||||
exit
|
||||
fi
|
||||
# TODO: Hacer que esto funcione
|
||||
### Funcion nueva
|
||||
for compfile in "$@"; do
|
||||
if [[ "$compfile" != "$1" && "$compfile" != "$2" ]];then
|
||||
if [ ! -d "$compfile" -a ! -f "$compfile" ];then
|
||||
printf -- "$(gettext "%s no such file or directory")" "$compfile"
|
||||
echo
|
||||
#exit
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
files=$3
|
||||
for (( i=4; i<=$#; i++))
|
||||
do
|
||||
files="$files $(echo $* | cut -f$i -d" ")"
|
||||
done
|
||||
sacaFormato $salida
|
||||
### Fin funcion nueva del tod
|
||||
#Funcion files nueva
|
||||
for compfile in "$@"; do
|
||||
if [[ "$compfile" != "$1" && "$compfile" != "$2" ]];then
|
||||
files="$files $compfile"
|
||||
fi
|
||||
done
|
||||
#Fin funcion files nueva
|
||||
## files anterior
|
||||
# files="$3"
|
||||
# for (( i=4; i<=$#; i++))
|
||||
# do
|
||||
# files="$files $(echo $* | cut -f$i -d" ")"
|
||||
# done
|
||||
sacaFormato "$salida"
|
||||
case $formato in
|
||||
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz")
|
||||
tar cvfa $salida $files
|
||||
msg $files $salida
|
||||
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz2" | "txz" | "tlz")
|
||||
tar cvfa "$salida" $files
|
||||
msg "$files" "$salida"
|
||||
;;
|
||||
"7z")
|
||||
7z a $salida $files
|
||||
msg $files $salida
|
||||
7z a "$salida" $files
|
||||
msg "$files" "$salida"
|
||||
;;
|
||||
"zip")
|
||||
zip $salida $files
|
||||
msg $files $salida
|
||||
zip "$salida" $files
|
||||
msg "$files" "$salida"
|
||||
;;
|
||||
"gz" | "lz")
|
||||
formato="${formato}ip"
|
||||
$formato -9kc $3 > $salida
|
||||
msg $3 $salida
|
||||
"$formato" -9kc "$3" > "$salida"
|
||||
msg "$3" "$salida"
|
||||
;;
|
||||
"xz")
|
||||
$formato -9kc $3 > $salida
|
||||
msg $3 $salida
|
||||
"$formato" -9kc "$3" > "$salida"
|
||||
msg "$3" "$salida"
|
||||
;;
|
||||
"bz2")
|
||||
$formato -9kc $3 > $salida
|
||||
msg $3 $salida
|
||||
"$formato" -9kc "$3" > "$salida"
|
||||
msg "$3" "$salida"
|
||||
;;
|
||||
"rar")
|
||||
echo "$(gettext "rar compression are not supported")" > /dev/stderr
|
||||
|
||||
3
jka-toolkit/pruebas
Normal file
3
jka-toolkit/pruebas
Normal file
@@ -0,0 +1,3 @@
|
||||
* hotfix
|
||||
master
|
||||
pruebas
|
||||
Reference in New Issue
Block a user