File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ set(COMPILE_WARNING_AS_ERROR 1)
88add_executable (${PROJECT_NAME} ${SRCS} )
99
1010install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
11+ install (PROGRAMS tools/concat.sh DESTINATION bin)
1112
1213# separate sha256 for windows, because both stdout shell redirect
1314# and piping stdout onward are in _TEXT
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ rm -f .concat.tmp
4+
5+ while [ ! -z " $1 " ] ; do
6+
7+ if [ ! -e " $1 " ] ; then
8+ echo " ABORTING: unable to find $1 - is cwd correct?"
9+ exit 1
10+ fi
11+
12+ echo >> .concat.tmp
13+ echo >> .concat.tmp
14+ echo " $1 :" >> .concat.tmp
15+ echo >> .concat.tmp
16+ echo ' ```' >> .concat.tmp
17+ cat $1 >> .concat.tmp
18+ echo ' ```' >> .concat.tmp
19+
20+ shift 1
21+ done
22+
23+ which xsel
24+ if [ $? -ne 0 ] ; then
25+ echo " xsel not available, dumping to stdout =============================================="
26+ cat .concat.tmp
27+ exit 0
28+ fi
29+ cat .concat.tmp | xsel
30+
31+ echo " Concatenated file contents in clipboard"
32+
33+ exit 0
You can’t perform that action at this time.
0 commit comments