Skip to content

Commit ff3d13a

Browse files
authored
Merge pull request #22 from ramnivas/robust-shell-sh
Make shell.sh invocable from the root directory
2 parents b2cfe2a + c6e1231 commit ff3d13a

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ Illustrates:
3434
Run the shell script to start Embabel under Spring Shell:
3535

3636
```bash
37-
cd scripts
38-
./shell.sh
37+
./scripts/shell.sh
3938
```
4039

4140
There is a single example agent, `WriteAndReviewAgent`.

scripts/shell.cmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
@echo off
22
setlocal
33

4-
set AGENT_APPLICATION=..
4+
set "script_dir=%~dp0"
5+
set AGENT_APPLICATION=%script_dir%.."
56

6-
call .\support\agent.bat
7+
call "%script_dir%support\agent.bat"
78

89
endlocal

scripts/shell.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env bash
22

3-
export AGENT_APPLICATION=..
3+
script_dir=$(dirname "$0")
4+
5+
export AGENT_APPLICATION="${script_dir}/.."
46

57
#export MAVEN_PROFILE=enable-mcp
68

7-
./support/check_env.sh || exit 1
9+
"$script_dir/support/check_env.sh" || exit 1
810

9-
cd ..
11+
cd "$AGENT_APPLICATION"
1012
mvn -Dmaven.test.skip=true spring-boot:run

0 commit comments

Comments
 (0)