1
0
mirror of https://gitlab.com/JKANetwork/jka-toolkit.git synced 2026-02-16 10:01:33 +01:00

Add addit, a simple managed of files with automatic enter and deleted lines (current only have alias managed). The gitdit now have in line 50 support for Untracked files

This commit is contained in:
JoseluCross
2016-07-01 19:58:19 +02:00
parent 8b1484a6d3
commit 71652c67d1
2 changed files with 33 additions and 2 deletions

31
jka-toolkit/addit Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# addit, A script to manage files with dialog
# Author: JKA Network - contacto@jkanetwork.com
VERSION="0.1.0"
options=`dialog --stdout --menu "addit - version: $version" 0 0 6 a "Manage permanent alias"`
case $options in
"a" )
reop=`dialog --stdout --menu "Select option" 0 0 6 0 "Add alias" 1 "Remove alias"`
case $reop in
0)
if [ -z "$(grep -o "if \[ -f ~/.bash_aliases \]; then" $HOME/.bashrc )" ];then
echo "ADD BY ADDIT - PERMIT USE ALIAS" >> $HOME/.bashrc
echo "if [ -f ~/.bash_aliases ]; then" >> $HOME/.bashrc
echo " . ~/.bash_aliases" >> $HOME/.bashrc
echo "fi" >> $HOME/.bashrc
fi
ali=`dialog --stdout --inputbox "Alias name to add" 0 60`
comand=`dialog --stdout --inputbox "Command" 0 60`
echo "alias $ali='$comand'" >> $HOME/.bash_aliases
echo "Restart $(tty)"
;;
1)
ali=`dialog --stdout --inputbox "Alias name to remove" 0 60`
sed -i '/$ali/d' $HOME/bash_aliases
echo "Restart $(tty)"
;;
esac
;;
esac

View File

@@ -47,8 +47,8 @@ if [ ! -z $gitopt ];then #No canceled
"p")
git pull $actual;;
"s")
estado=$(git status | grep -o "^Changes" ) #It need to commit something?
if [ $estado ];then #When is necesary commit
estado=$(git status | grep -oE "^Changes|^Untracked" ) #It need to commit something?
if [ "$estado" ];then #When is necesary commit
commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
if [[ -z $commit ]];then
commit="changes"