我有一个实用程序,用于使用 genstrings 在一些子目录中提取本地化字符串,用于一个 Objective-C 项目,如下所示:
#!/bin/bash
APP_SOURCES="AccessoryViews/*.m Clouds/*.m CustomStyles/*.m"
cd ~/Documents/Projects/MyProject
genstrings ${APP_SOURCES} && ~/Documents/Projects/MyProject/stringsfmt -move -from Localizable.strings -to L10n/Base.lproj/Localizable.strings
这曾经在 MacOS 11 中正常工作,但在我安装 MacOS 12.2 后停止工作。运行它时,我收到此错误:
fatal error: runtime: bsdthread_register error
runtime stack:
runtime.throw(0x13ae8e, 0x21)
/usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:566 +0x95 fp=0x7ff7bfeff9c0 sp=0x7ff7bfeff9a0
runtime.goenvs()
/usr/local/Cellar/go/1.7.1/libexec/src/runtime/os_darwin.go:88 +0xa0 fp=0x7ff7bfeff9f0 sp=0x7ff7bfeff9c0
runtime.schedinit()
/usr/local/Cellar/go/1.7.1/libexec/src/runtime/proc.go:450 +0x9c fp=0x7ff7bfeffa30 sp=0x7ff7bfeff9f0
runtime.rt0_go(0x7ff7bfeffa60, 0x6, 0x7ff7bfeffa60, 0x1000, 0x6, 0x7ff7bfeffbd8, 0x7ff7bfeffc12, 0x7ff7bfeffc18, 0x7ff7bfeffc1e, 0x7ff7bfeffc32, ...)
/usr/local/Cellar/go/1.7.1/libexec/src/runtime/asm_amd64.s:145 +0x14f fp=0x7ff7bfeffa38 sp=0x7ff7bfeffa30
SO上有一些类似的问题,例如建议将bash更改为zsh。当我这样做时, bsdthread_register 错误消失了,但是,然后我收到了这个错误:
genstrings: error: failed to read input file AccessoryViews/*.m Clouds/*.m CustomStyles/*.m
好像 genstrings 在 zsh 下使用时不接受通配符?
关于如何解决这个问题的任何想法,最好使用 bash
提前致谢,