-
Notifications
You must be signed in to change notification settings - Fork 9
fix(devcontainer): generate common locales and greet each new terminal #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env bash | ||
| # Sourced by ~/.bashrc inside the dev container. post-create.sh installs the | ||
| # line that sources it, so a fresh container gets both halves below. | ||
|
|
||
| # The host's locale arrives over SSH: OpenSSH sends LANG and LC_* by default, | ||
| # and DevPod's shell inherits them. When the value names a locale this image | ||
| # has not generated, every command warns "setlocale: cannot change locale" | ||
| # and manpath gives up. Fall back to the image's UTF-8 locale instead. | ||
| if [ -n "${LANG:-}" ] && ! locale -a 2>/dev/null | grep -qix "$(printf '%s' "$LANG" | sed 's/UTF-8$/utf8/')"; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Validate every locale override, not only When 🤖 Prompt for AI Agents |
||
| export LANG=C.UTF-8 | ||
| unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME | ||
| fi | ||
|
|
||
| # The rest is for a person at a prompt. | ||
| case $- in *i*) ;; *) return 0 2>/dev/null || exit 0 ;; esac | ||
|
|
||
| backend="not started" | ||
| if [ -f "${WORKSPACE_ROOT:-$PWD}/.env" ]; then | ||
| backend="$(sed -n 's/^BASE_URL=//p' "${WORKSPACE_ROOT:-$PWD}/.env" | head -1)" | ||
| backend="${backend:-not started}" | ||
| fi | ||
|
|
||
| cat <<EOF | ||
|
|
||
| Druxt Quickstart | ||
| Backend: ${backend} | ||
| Frontend: http://localhost:3000 once \`npm run dev\` is running | ||
|
|
||
| npm run dev Nuxt dev server against the backend | ||
| npm run info Backend details and versions | ||
| npm run login One-time Drupal login link | ||
| npm run stop Stop the backend | ||
| make help Everything else | ||
|
|
||
| EOF | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: druxt/quickstart
Length of output: 154
🤖 get_repo_knowledge executed:
get_repo_knowledge druxt/quickstart /tmp/coderabbit-repo-knowledge/druxt-quickstart-db6998f2Length of output: 386
🏁 Script executed:
Repository: druxt/quickstart
Length of output: 8810
Configure the locale fallback before Bash starts.
~/.bashrcruns after Bash initialization. An invalid inherited locale can therefore produce asetlocalewarning beforeshell-init.shclears it. Set the fallback in the container environment or in a wrapper that runs before Bash.🧰 Tools
🪛 Shellcheck (0.11.0)
[info] 77-77: Expressions don't expand in single quotes, use double quotes for that.
(SC2016)
🤖 Prompt for AI Agents
Source: MCP tools