fixed bugs in regex pattern

This commit is contained in:
PREVENT_DEFAULT
2025-04-17 16:42:19 +02:00
committed by l_samenv
parent 9c707e2375
commit 16bb53784c

View File

@ -8,7 +8,7 @@ GITEA_URL = 'https://gitea.psi.ch/linse/%s.git'
GET_GITEA_TOKEN = """#!/bin/bash
if [ -z "$GITEA_TOKEN" ]; then
re='^([0-9a-f]{8:}) ([^ ]*) (.*)?$'
re='^([0-9a-f]{8,}) ([^ ]*) (.*)$'
if [[ "$LC_IDENTIFICATION" =~ $re ]]; then
export GITEA_TOKEN=${BASH_REMATCH[1]}
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 "" 1>&2
echo quit=1
exit
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
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
re='^([0-9a-f]{8:}) ([^ ]*) (.*)?$'
re='^([0-9a-f]{8,}) ([^ ]*) (.*)?$'
if [[ "$LC_IDENTIFICATION" =~ $re ]]; then
export GIT_AUTHOR_EMAIL=${BASH_REMATCH[2]}
export GIT_AUTHOR_NAME=${BASH_REMATCH[3]}
@ -47,7 +47,7 @@ fi
"""
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:
lines = []
else: