refactor slightly
(ensure): Don't repeat "$src/$fn" and "$dst/$fn"; instead, compute them once as "$src" and "$dst", respectively.
This commit is contained in:
parent
2805018da2
commit
f377076174
@ -17,13 +17,13 @@ ensure ()
|
|||||||
# $2 -- src dir under contrib/
|
# $2 -- src dir under contrib/
|
||||||
# $3 -- dst dir under ./
|
# $3 -- dst dir under ./
|
||||||
fn="$1"
|
fn="$1"
|
||||||
src="contrib/$2"
|
src="contrib/$2/$fn"
|
||||||
dst="./$3"
|
dst="./$3/$fn"
|
||||||
|
|
||||||
if ! diff $src/$fn $dst/$fn > /dev/null
|
if ! diff $src $dst > /dev/null
|
||||||
then
|
then
|
||||||
cp $src/$fn $dst/$fn
|
cp $src $dst
|
||||||
chmod -w $dst/$fn
|
chmod -w $dst
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user