mirror of
https://github.com/chenasraf/gitlab-search-alfred-workflow.git
synced 2026-05-17 17:48:01 +00:00
feat: add log date
This commit is contained in:
9
search
9
search
@@ -11,7 +11,8 @@ SUFFIX="$2"
|
||||
URL_DESC="${3:-Project}"
|
||||
|
||||
log() {
|
||||
echo "$@" >> log.txt
|
||||
fdate=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
echo "[$fdate] $*" >> log.txt
|
||||
}
|
||||
|
||||
if [[ -z "$GROUP" ]]; then
|
||||
@@ -33,16 +34,14 @@ else
|
||||
mkdir .cache
|
||||
fi
|
||||
|
||||
# remove files older than 1 week
|
||||
find .cache -type f -mtime +7 -name '*.json' -exec rm {} \;
|
||||
# remove files older than 30 days
|
||||
find .cache -type f -mtime +30 -name '*.json' -exec rm {} \;
|
||||
|
||||
query=$1
|
||||
hash=$(echo "$query" | md5 -q)
|
||||
|
||||
log "Query: $query, Hash: $hash"
|
||||
|
||||
log "Query: $query, Hash: $hash"
|
||||
|
||||
# cache file location
|
||||
fl=".cache/projects-$hash.json"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user