#!/bin/bash

if [ "$1" = "install" ]
then
    
    if [ -d "wiki/.git" ]
    then 
    python -m nbresnote $1 
    else
    ORIGIN=`git remote get-url origin`.git
    if [ `echo $ORIGIN|grep '.git$'|wc -l` -eq 1 ]
    then
        ORIGIN=`echo ${ORIGIN}| rev|cut -c 5-| rev`
    fi
    git clone ${ORIGIN}.wiki wiki && python -m nbresnote $1 
    fi
    
else
    python -m nbresnote $@
fi