fixed bugs in regex pattern
This commit is contained in:

committed by
l_samenv

parent
9c707e2375
commit
16bb53784c
18
gitea.py
18
gitea.py
@ -8,7 +8,7 @@ GITEA_URL = 'https://gitea.psi.ch/linse/%s.git'
|
|||||||
|
|
||||||
GET_GITEA_TOKEN = """#!/bin/bash
|
GET_GITEA_TOKEN = """#!/bin/bash
|
||||||
if [ -z "$GITEA_TOKEN" ]; then
|
if [ -z "$GITEA_TOKEN" ]; then
|
||||||
re='^([0-9a-f]{8:}) ([^ ]*) (.*)?$'
|
re='^([0-9a-f]{8,}) ([^ ]*) (.*)$'
|
||||||
if [[ "$LC_IDENTIFICATION" =~ $re ]]; then
|
if [[ "$LC_IDENTIFICATION" =~ $re ]]; then
|
||||||
export GITEA_TOKEN=${BASH_REMATCH[1]}
|
export GITEA_TOKEN=${BASH_REMATCH[1]}
|
||||||
export GIT_AUTHOR_NAME=${BASH_REMATCH[3]}
|
export GIT_AUTHOR_NAME=${BASH_REMATCH[3]}
|
||||||
@ -18,18 +18,18 @@ if [ -z "$GITEA_TOKEN" ]; then
|
|||||||
echo "please use 'setuser <user name>' to identify yourself" 1>&2
|
echo "please use 'setuser <user name>' to identify yourself" 1>&2
|
||||||
echo "" 1>&2
|
echo "" 1>&2
|
||||||
echo quit=1
|
echo quit=1
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
if [ "$1" == "get" ]; then
|
|
||||||
echo "connecting with gitea token for $GIT_AUTHOR_NAME" 1>&2
|
|
||||||
fi
|
|
||||||
echo "username=_"
|
|
||||||
echo "password=$GITEA_TOKEN"
|
|
||||||
fi
|
fi
|
||||||
|
if [ "$1" == "get" ]; then
|
||||||
|
echo "connecting with gitea token for $GIT_AUTHOR_NAME" 1>&2
|
||||||
|
fi
|
||||||
|
echo "username=_"
|
||||||
|
echo "password=$GITEA_TOKEN"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PRE_COMMIT_HOOK = """#!/bin/bash
|
PRE_COMMIT_HOOK = """#!/bin/bash
|
||||||
re='^([0-9a-f]{8:}) ([^ ]*) (.*)?$'
|
re='^([0-9a-f]{8,}) ([^ ]*) (.*)?$'
|
||||||
if [[ "$LC_IDENTIFICATION" =~ $re ]]; then
|
if [[ "$LC_IDENTIFICATION" =~ $re ]]; then
|
||||||
export GIT_AUTHOR_EMAIL=${BASH_REMATCH[2]}
|
export GIT_AUTHOR_EMAIL=${BASH_REMATCH[2]}
|
||||||
export GIT_AUTHOR_NAME=${BASH_REMATCH[3]}
|
export GIT_AUTHOR_NAME=${BASH_REMATCH[3]}
|
||||||
@ -47,7 +47,7 @@ fi
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def write_when_new(doit, filename, content, executable=False):
|
def write_when_new(doit, filename, content, executable=False):
|
||||||
newmode = 0o755 is executable else 0o644
|
newmode = 0o755 if executable else 0o644
|
||||||
if content is None:
|
if content is None:
|
||||||
lines = []
|
lines = []
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user