mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Check the same config path as the CLI before initializing so existing custom and XDG configurations do not trigger a first-run setup.
16 lines
489 B
Bash
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 "$@"
|