PicGo-Core icon indicating copy to clipboard operation
PicGo-Core copied to clipboard

fix(cli): filters optional

Open imba97 opened this issue 9 months ago • 0 comments

修复以下报错

$ picgo init imba97/picgo-template-plugin-test picgo-template-plugin-test-1

[PicGo INFO]: Template files are downloading...
[PicGo SUCCESS]: Template files are downloaded!
? Plugin name: test   
? Plugin description: test plugin
? author: imba97    
? Github user/repo: imba97/picgo-plugin-test
[PicGo ERROR]: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at C:\Users\imba97\AppData\Local\npm-cache\_npx\2376b2220af0d629\node_modules\picgo\dist\index.cjs.js:1:9435     
    at Array.filter (<anonymous>)
    at ye (C:\Users\imba97\AppData\Local\npm-cache\_npx\2376b2220af0d629\node_modules\picgo\dist\index.cjs.js:1:9400)

目前版本使用 init 初始化自定义模板时,如果模板没有定义 filters 会报错,原因是 Object.keys(undefined)

但看官方文档里说 filters 是可选的

imba97 avatar May 10 '25 05:05 imba97