Skip to content

Commit

Permalink
fixed launcher script
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikN committed Jul 10, 2024
1 parent d74419f commit 5fa60c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
env:
SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS: 1

# # Make sure the snap is installable
# - run: |
# sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
# Make sure the snap is installable
- run: |
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
# Save snap for subsequent job(s)
- uses: actions/upload-artifact@v3
Expand Down
40 changes: 14 additions & 26 deletions snap/local/launcher.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
#!/bin/bash -e

log() {
local message="$1"
# Log the message with logger
logger -t "${SNAP_NAME}" "launcher: $message"
}

log_and_echo() {
local message="$1"
# Log the message with logger
logger -t "${SNAP_NAME}" "configure hook: $message"
# Echo the message to standard error
echo >&2 "$message"
}
source $SNAP/usr/bin/utils.sh

# Iterate over the snap parameters and retrieve their value.
# If a value is set, it is forwarded to the launch file.

OPTIONS="\
name \
parent-frame \
camera-model \
cam-pos-x \
cam-pos-y \
cam-pos-z \
cam-roll \
cam-pitch \
cam-yaw \
params-file \
"
OPTIONS=(
name
parent-frame
camera-model
cam-pos-x
cam-pos-y
cam-pos-z
cam-roll
cam-pitch
cam-yaw
params-file
)

LAUNCH_OPTIONS=""

for OPTION in ${OPTIONS}; do
for OPTION in "${OPTIONS[@]}"; do
VALUE="$(snapctl get driver.${OPTION})"
if [ -n "${VALUE}" ]; then
OPTION_WITH_UNDERSCORE=$(echo ${OPTION} | tr - _)
Expand Down

0 comments on commit 5fa60c4

Please sign in to comment.