mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
projects-dir.mk: Add git-echo-link-% and friends
git-echo-link-<filename> returns a string functioning as hyperlink to the file in git if embedded into a janware wiki or ticket. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
193db3ecdb
commit
749ab5273b
1 changed files with 16 additions and 2 deletions
|
|
@ -52,6 +52,7 @@ SSH_WRAPPER_SH := $(CWD)/ssh-wrapper.sh
|
|||
|
||||
EXCLUDES_FILE ?= exclude.txt
|
||||
EXCLUDES_FILES = exclude-$(shell $(GET_OS_SH) name).txt exclude-$(shell $(GET_OS_SH)).txt $(EXCLUDES_FILE)
|
||||
TEXT_FILES_CACHE ?= text-files.txt
|
||||
|
||||
ifneq ($(wildcard $(EXCLUDES_FILES)),)
|
||||
EXCLUDE_FROM_BUILD += $(shell sed 's/\#.*//g' $(wildcard $(EXCLUDES_FILES)))
|
||||
|
|
@ -258,6 +259,11 @@ git-show-non-master-branches:
|
|||
fi ;\
|
||||
done
|
||||
|
||||
# git-echo-link-<filename> returns a string functioning as hyperlink to
|
||||
# matching files in git, if embedded into a janware wiki or ticket.
|
||||
git-echo-link-%: | $(TEXT_FILES_CACHE)
|
||||
sed "/$*$$/!d; s%$(CWD)%%; s|^|\n \[\[jgit>/proj/$(JANWARE_USER)/|; s/$$/|$*\]\]\n/" $(TEXT_FILES_CACHE)
|
||||
|
||||
pull-%: $(SSH_WRAPPER_SH)
|
||||
PGIT_CLONE_FROM_USER=$* $(PGIT) clone
|
||||
|
||||
|
|
@ -341,8 +347,16 @@ list-files:
|
|||
xargs -0 realpath ;\
|
||||
done
|
||||
|
||||
list-text-files:
|
||||
@make --no-print-directory list-files | xargs file -N | grep ":.*text" | cut -d: -f1
|
||||
clean: clean.text-files-cache
|
||||
clean.text-files-cache:
|
||||
rm -f $(TEXT_FILES_CACHE)
|
||||
$(TEXT_FILES_CACHE):
|
||||
@make text-files-update
|
||||
text-files-update:
|
||||
@make --no-print-directory list-files | xargs file -N | grep ":.*text" | cut -d: -f1 | tee $(TEXT_FILES_CACHE).tmp
|
||||
mv $(TEXT_FILES_CACHE).tmp $(TEXT_FILES_CACHE)
|
||||
text-files-list list-text-files: | $(TEXT_FILES_CACHE)
|
||||
@cat $<
|
||||
|
||||
loc-all:
|
||||
@make --no-print-directory list-text-files | \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue