link

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2025 PRAS

Index

Constants

This section is empty.

Variables

View Source
var LinkCmd = &cobra.Command{
	Use:   "link",
	Short: "Link plasmoid to local development directory",
	Long:  "Create a symlink to local development folder for easy testing.",
	Run: func(cmd *cobra.Command, args []string) {
		if !utilsIsValidPlasmoid() {
			color.Red("Current directory is not a valid plasmoid.")
			return
		}
		dest, err := utilsGetDevDest()
		if err != nil {
			color.Red(err.Error())
			return
		}
		if linkWhere {
			fmt.Println("Plasmoid linked to:\n", "- ", color.BlueString(dest))
			return
		}
		if err := LinkPlasmoid(dest); err != nil {
			color.Red("Failed to link plasmoid:", err)
			return
		}
		color.Green("Plasmoid linked successfully.")
	},
}

devCmd represents the dev command

View Source
var LinkPlasmoid = func(dest string) error {

	_ = osRemoveAll(dest)

	cwd, err := osGetwd()
	if err != nil {
		return err
	}

	return osSymlink(cwd, dest)
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL