Skip to content

Commit

Permalink
feat: extract parse mount arg
Browse files Browse the repository at this point in the history
  • Loading branch information
absternator committed Dec 9, 2024
1 parent 222a2e5 commit 52bede2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You can also run everything outside pm2, by separately running:
- `./scripts/run_server`
- `./scripts/run_client`

*Note: If you wish to override the volune with a custom bind mount pass in -mount {MOUNT_NAME} into `run_test` script*
*Note: If you wish to override the storage volume with a custom bind mount pass in -mount {MOUNT_NAME} into `run_test` script*

## Config
Config for the front-end lives in `./app/client/src/settings` and by default webpack (via the vue-cli) will use the config
Expand Down
17 changes: 17 additions & 0 deletions scripts/parse_mount_arg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parse_mount_arg() {
local mount=""

while [ $# -gt 0 ]; do
case "$1" in
-mount)
mount="$2"
shift 2
;;
*)
shift
;;
esac
done

echo "$mount"
}
14 changes: 3 additions & 11 deletions scripts/run_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ HERE=$(realpath "$(dirname $0)")
. $HERE/common


while [ $# -gt 0 ]; do
case "$1" in
-mount)
MOUNT="$2"
shift 2
;;
*)
shift
;;
esac
done
. $HERE/parse_mount_arg
MOUNT=$(parse_mount_arg "$@")

if [ -z "$MOUNT" ]; then
echo "No mount path provided, using default: $VOLUME"
MOUNT=$VOLUME
Expand Down
13 changes: 2 additions & 11 deletions scripts/run_test
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,8 @@ set -e

HERE=$(realpath "$(dirname $0)")

while [ $# -gt 0 ]; do
case "$1" in
-mount)
MOUNT="$2"
shift 2
;;
*)
shift
;;
esac
done
. $HERE/parse_mount_arg
MOUNT=$(parse_mount_arg "$@")
. $HERE/run_dependencies -mount $MOUNT


Expand Down

0 comments on commit 52bede2

Please sign in to comment.