#!/bin/bash ### # 辅助生成代码脚本 # 可以通过codegen.properties配置数据库、代码包结构等 ## # get real path of softlink get_real_path() { local f="$1" while [ -h "$f" ]; do ls=`ls -ld "$f"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then f="$link" else f=`dirname "$f"`/"$link" fi done echo "$f" } prg_path=$(get_real_path "$0") echo "Script path [$prg_path]" # Service Home pushd $(dirname "$prg_path") WORK_DIR=$(pwd) echo "Work dir [$WORK_DIR]" mvn -T 4C -am -DskipTests -pl lib/tigon/codegen spring-boot:run \ -Dspring-boot.run.arguments="--tigon.codegen.work-dir=$WORK_DIR --spring.config.location=$WORK_DIR/codegen.yml --server.port=8088" popd