fix(desktop): make run.sh work in non-English locales#7172
fix(desktop): make run.sh work in non-English locales#7172beastoin merged 1 commit intoBasedHardware:mainfrom
Conversation
The timing helpers feed `bc` output (dot-decimal) into bash's `printf %f`, which fails with "invalid number" when the user's shell runs in a locale that uses a comma decimal separator (e.g. de_DE.UTF-8). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes a one-liner crash in
Confidence Score: 5/5Safe to merge — the change is a single targeted export that restores expected behavior for non-English locale users without side effects on other locale categories. The fix is exactly one line ( No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[run.sh starts] --> B[export LC_NUMERIC=C]
B --> C[SCRIPT_START_TIME = date +%s.%N]
C --> D{Script step executes}
D --> E["bc computes elapsed time\n(dot-decimal, e.g. 0.018953)"]
E --> F["printf '%6.1f' elapsed_time"]
F --> G["LC_NUMERIC=C → dot accepted\n✅ prints [ 0.0s]"]
H[Without fix] --> I[User's LC_NUMERIC = de_DE.UTF-8]
I --> J["printf '%6.1f' 0.018953"]
J --> K["❌ printf: .018953: invalid number"]
Reviews (1): Last reviewed commit: "fix(desktop): force LC_NUMERIC=C in run...." | Re-trigger Greptile |
|
lgtm @de4nde |
Summary
desktop/run.shfails on first run for users whose shell runs in a non-English locale (e.g.de_DE.UTF-8):step()/substep()timing helpers feedbcoutput (dot-decimal, e.g..018953000) into bash'sprintf "%6.1f", which respectsLC_NUMERICand rejects the dot when the locale expects a comma as decimal separator.export LC_NUMERIC=Cnear the top ofrun.shso numeric formatting stays POSIX regardless of the user's shell locale. Other locale categories (messages, etc.) are untouched.Test plan
LANG=de_DE.UTF-8:printf: .018953000: invalid numberprintfcall prints[ 0.0s]cleanly underLANG=de_DE.UTF-8🤖 Generated with Claude Code