elveos

elveos Git Source Tree

Root/doc/installSd.sh

1#!/bin/bash
2
3if [ "$(id -u)" != 0 ] ; then
4    echo You must be root
5    exit 1
6fi
7
8apt-get install sd
9apt-get install libnet-github-perl
10apt-get install libpath-class-perl
11echo "alias sd='git-sd'" >> ~/.bashrc
12
13cat << 'END' > /etc/bash_completion.d/sd
14#!bash
15
16_sd_complete()
17{
18    local cur prev opts
19    COMPREPLY=()
20    cur="${COMP_WORDS[COMP_CWORD]}"
21    prev="${COMP_WORDS[COMP_CWORD-1]}"
22    always="-v --verbose"
23
24    if [[ $COMP_CWORD -eq 1 ]] ; then
25        opts="init clone setting ticket publish help push pull server"
26    elif [[ $COMP_CWORD -eq 2 ]] ; then
27        case $prev in
28            "ticket" )
29            opts="create update list edit search basics show history delete take give resolved comment attachment"
30        ;;
31    esac
32    fi
33    COMPREPLY=( $(compgen -W "${opts} ${always}" -- ${cur}) )
34}
35complete -F _sd_complete sd
36END
37
38cat << END
39To make sure you can use "sd" re-launch your terminal.
40then :
41    sd config edit
42    sd setting edit
43    cd bloatit
44    sd pull -from github:BloatIt/bloatit
45
46    sd tiket list
47    sd tiket create
48
49see http://syncwith.us/sd/using
50END
51

Archive Download this file