Skip to content

fix(cli): filters optional #178

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

imba97
Copy link

@imba97 imba97 commented May 10, 2025

修复以下报错

$ 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 是可选的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant