Skip to content

Commit

Permalink
simplify bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 committed Nov 12, 2024
1 parent 0624fd7 commit 79ac535
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
*.iml
*~
/out

/cp
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ requires net.jbock;

````sh
./mvnw clean package
jpackage --name cp --type app-image --module-path `./get_module_path` --module jbock.maven.example/net.jbock.cp.CopyFile --dest target/out
./create_launcher_script >cp && chmod +x cp
./mvnw dependency:copy-dependencies -DincludeScope=runtime
./cp --help
./cp 1 -s2 2
````
Expand Down
2 changes: 2 additions & 0 deletions cp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
java --module-path $(./get_module_path) --module jbock.maven.example/net.jbock.cp.CopyFile $@
5 changes: 0 additions & 5 deletions create_launcher_script

This file was deleted.

5 changes: 2 additions & 3 deletions get_module_path
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ join_tokens () {
}

JARS=()
for JAR in `find target -name "*.jar"`; do
for JAR in target/*.jar target/dependency/*.jar; do
JARS+=("${JAR}")
done
MODULE_PATH=`join_tokens ${JARS[@]}`
echo "$MODULE_PATH"
join_tokens ${JARS[@]}

0 comments on commit 79ac535

Please sign in to comment.