Files
skillshare/docker/production/entrypoint.sh
T
Rusty Shackleford bab172d1a7 fix(docker): respect global config path on startup (#655)
Check the same config path as the CLI before initializing so existing custom and XDG configurations do not trigger a first-run setup.
2026-10-27 17:56:24 +08:00

16 lines
489 B
Bash

#!/bin/bash
# Production entrypoint: initialise config if missing, then exec CMD.
set -e
config_path=${SKILLSHARE_CONFIG:-}
if [ -z "$config_path" ]; then
# Go's filepath.Join cleans the base path without resolving symlinks.
config_path=$(realpath -ms "${XDG_CONFIG_HOME:-$HOME/.config}/skillshare/config.yaml")
fi
if [ ! -f "$config_path" ]; then
echo "First run: initialising skillshare config..."
skillshare init -g --no-copy --no-git --skill 2>/dev/null || true
fi
exec "$@"