projects
/
m6w6
/
repo-template
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
add mdref support
[m6w6/repo-template]
/
init
diff --git
a/init
b/init
index d9917291515730a0977857160c1e5545d50492f4..faf9cac1988925ca5364c9724d9153891323b15c 100755
(executable)
--- a/
init
+++ b/
init
@@
-4,6
+4,13
@@
export REPO=$(basename $(pwd) .git)
export REPO=$(basename $(pwd) .git)
+if test $(uname) = "Linux"
+then
+ MKTEMP=mktemp
+else
+ MKTEMP="mktemp -t repo-template"
+fi
+
while test $# -gt 0
do
export "$1"
while test $# -gt 0
do
export "$1"
@@
-19,17
+26,23
@@
do
;;
composer.json)
test "${COMPOSER+set}" = "" && continue
;;
composer.json)
test "${COMPOSER+set}" = "" && continue
- SRCFILE=$(
mktemp -t $RANDOM
)
+ SRCFILE=$(
$MKTEMP
)
php -d variables_order=E $(dirname -- $0)/presets/composer.json >$SRCFILE
;;
php -d variables_order=E $(dirname -- $0)/presets/composer.json >$SRCFILE
;;
- package.xml|CREDITS)
+ package.xml|CREDITS
|config.*|Makefile.frag
)
test "${PECL+set}" = "" && continue
test "${PECL+set}" = "" && continue
- SRCFILE=$(mktemp -t $RANDOM)
- php -d variables_order=E $(dirname -- $0)/presets/package.xml >$SRCFILE
+ SRCFILE=$($MKTEMP)
+ php -d variables_order=E $(dirname -- $0)/presets/$FILE >$SRCFILE
+ ;;
+ README.md|LICENSE)
+ SRCFILE=$($MKTEMP)
+ php -d variables_order=E $(dirname -- $0)/presets/$FILE >$SRCFILE
;;
;;
- README.md)
- SRCFILE=$(mktemp -t $RANDOM)
- php -d variables_order=E $(dirname -- $0)/presets/README.md >$SRCFILE
+ mdref.mdref)
+ test "${MDREF+set}" = "" && continue
+ SRCFILE=$($MKTEMP)
+ php -d variables_order=E $(dirname -- $0)/presets/$FILE >$SRCFILE
+ FILE=$MDREF.mdref
;;
*)
;;
;;
*)
;;
@@
-38,8
+51,7
@@
do
if test -e $FILE
then
DIFF="diff -udbBE -- $SRCFILE $FILE"
if test -e $FILE
then
DIFF="diff -udbBE -- $SRCFILE $FILE"
- # ignore changes with only additions or removals
- if ! $DIFF | awk '{if(NR<4){next}}/^-/{if(p){exit 1}m++}/^\+/{if(m){exit 1}p++}'
+ if ! $DIFF >/dev/null
then
while read -n 1 -p "File $FILE exists and differs (q,s,r,d,v,?) " ACTION
do
then
while read -n 1 -p "File $FILE exists and differs (q,s,r,d,v,?) " ACTION
do