swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

Ask to run the init command instead of printing an error

Open FranzBusch opened this issue 10 months ago • 1 comments

I just installed Swiftly fresh on my system and tried to run swiftly list but was faced with this error

Error(message: "Could not load swiftly\'s configuration file at /Users/franzbusch/Library/Application Support/swiftly/config.json.\n\nTo begin using swiftly you can install it: \'swiftly init\'.")

It would be great if this auto prompts to run swiftly init instead of leaving me to type it.

FranzBusch avatar Jan 30 '25 16:01 FranzBusch

@FranzBusch thanks for reporting this. There was a fix for the error message unwrapping that was merged into the main branch after the cut of the 0.4.0-dev release that should make the error message easier to read.

In terms of auto-prompting, would swiftly then block waiting on user input in this case? If so, how would one disable the prompt in an automated process with an --assume-yes/-y given that this can happen for any swiftly subcommand, such as ones that don't support that flag? The swiftly init subcommand has a good set of flags and options to control the init behaviour in headless environments.

cmcgee1024 avatar Feb 03 '25 18:02 cmcgee1024