Documentation
¶
Overview ¶
Copyright 2025 PRAS
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FormatCmd = &cobra.Command{ Use: "format", Short: "Prettify QML files", Long: "Automatically format QML source files to ensure consistent style and readability.", Run: func(cmd *cobra.Command, args []string) { if !utilsIsValidPlasmoid() { fmt.Println(color.RedString("Current directory is not a valid plasmoid.")) return } if !utilsIsPackageInstalled(consts.QmlFormatPackageName["binary"]) { pm, _ := utilsDetectPackageManager() var confirm bool confirmPrompt := &survey.Confirm{ Message: "qmlformat is not installed. Do you want to install it?", Default: true, } if err := surveyAskOne(confirmPrompt, &confirm); err != nil { return } if confirm { if err := utilsInstallPackage(pm, consts.QmlFormatPackageName["binary"], consts.QmlFormatPackageName); err != nil { fmt.Println(color.RedString("Failed to install qmlformat.")) return } fmt.Println(color.GreenString("qmlformat installed successfully.")) } else { fmt.Println(color.YellowString("Operation cancelled.")) return } } crrPath, _ := os.Getwd() relPath := filepath.Join(crrPath, dir) if watch { prettifyOnWatch(relPath, make(chan bool)) } else { prettify(relPath) } }, }
FormatCmd represents the format command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.