-
-
Notifications
You must be signed in to change notification settings - Fork 8
fix: use hexo-fs to read google key file instead of require #18
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
Conversation
yqs112358 大佬你改的这版本加载失败:
|
奇怪了,我代码里特定判定过 |
用的原先的JSON文件,文档里没见要改的说明,请问用环境变量该怎么配?_config.yml里
|
@828767 对,用环境变量的话 channels->google->key 这个配置项写空字符串就行 |
@yqs112358 您好,我也碰到了相同的问题,使用
我是直接使用
想请教下,这种情况应该如何修改 |
应该是这个原因。我就寻思着代码里面判断过文件和目录了,不应该出问题才对。 |
目前如果通过环境变量传递
GOOGLE_KEY
,并且将配置文件中url_submission
->google
->key
配置项置空时,这里hexo-url-submission/src/google_deployer.ts
Line 28 in 49c4ca1
的
require
会抛出异常,导致永远输出Google key file not exist, cancel submission.
,后面的JSON.parse(process.env.GOOGLE_KEY || '{}')
不会被执行。如图:
使用

hexo-fs
代替require
读取google key,解决了此问题。修复后: