Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gth99spB1CzQmBFofXmU4Z
10 lines
543 B
Bash
Executable File
10 lines
543 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# usage: rewrite.sh <from-dir> <to-dir> <recipe-fqn> (copies from-dir to to-dir and runs the recipe there)
|
|
set -uo pipefail
|
|
RW=6.46.1; SPRING=6.37.1; MIGRATE=3.42.1
|
|
rm -rf "$2"; mkdir -p "$(dirname "$2")"; cp -r "$1" "$2"; rm -rf "$2/target"
|
|
cd "$2"
|
|
mvn -B -q org.openrewrite.maven:rewrite-maven-plugin:$RW:run \
|
|
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:$SPRING,org.openrewrite.recipe:rewrite-migrate-java:$MIGRATE \
|
|
-Drewrite.activeRecipes="$3" -Drewrite.exportDatatables=false 2>&1
|