summaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorgjoranv <gjoranv@gmail.com>2023-08-29 10:55:52 +0200
committergjoranv <gjoranv@gmail.com>2023-08-29 11:31:30 +0200
commit769da494a5e51554fbb423aad4957732f790b4aa (patch)
tree32dfaa45f22a6593a40a6f6a2d034661611c1d33 /bootstrap.sh
parent027fafe9cceb669dbd93079a2c888f611d63c77d (diff)
Add function to forcefully and safely move files/dirs to '.'
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index 7df95b31d65..191e3161290 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -48,6 +48,15 @@ mvn_install() {
${MAVEN_CMD} --batch-mode --no-snapshot-updates -Dmaven.wagon.http.retryHandler.count=5 clean install ${MAVEN_EXTRA_OPTS} "$@"
}
+force_move() {
+ local src_dir=$1
+ local file=$2
+
+ rm -rf "./${file:?}"
+ cp -r "$src_dir/${file:?}" .
+ rm -rf "$src_dir/${file:?}"
+}
+
# Generate vtag map
top=$(dirname $0)
$top/dist/getversionmap.sh $top > $top/dist/vtag.map
@@ -66,9 +75,8 @@ $top/dist/getversionmap.sh $top > $top/dist/vtag.map
# Set up maven wrapper. TODO: use here and in vespa build.
echo "Setting up maven wrapper in $(pwd)"
mvn wrapper:wrapper -Dmaven=3.8.8 -f maven-plugins/pom.xml
-rm -rf .mvn
-cp -r maven-plugins/.mvn maven-plugins/mvnw .
-rm -rf maven-plugins/.mvn
+force_move maven-plugins .mvn
+force_move maven-plugins mvnw
rm -f maven-plugins/mvnw*
echo "Using maven command: ${MAVEN_CMD}"
${MAVEN_CMD} -v