build

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: 12 Imported by: 0

Documentation

Overview

Copyright 2025 PRAS

Index

Constants

This section is empty.

Variables

View Source
var AddDirToZip = func(zipWriter *zip.Writer, baseDir string) error {
	return filepathWalk(baseDir, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		relPath := path
		if strings.HasPrefix(path, "./") {
			relPath = path[2:]
		}

		if info.IsDir() {
			return nil
		}

		file, err := osOpen(path)
		if err != nil {
			return err
		}
		defer func() {
			if err := file.Close(); err != nil {
				log.Printf("Error closing file: %v", err)
			}
		}()

		w, err := zipWriter.Create(relPath)
		if err != nil {
			return err
		}

		_, err = ioCopy(w, file)
		return err
	})
}
View Source
var AddFileToZip = func(zipWriter *zip.Writer, filename string) error {
	file, err := osOpen(filename)
	if err != nil {
		return err
	}
	defer func() {
		if err := file.Close(); err != nil {
			log.Printf("Error closing file: %v", err)
		}
	}()

	w, err := zipWriter.Create(filename)
	if err != nil {
		return err
	}
	_, err = ioCopy(w, file)
	return err
}
View Source
var BuildCmd = &cobra.Command{
	Use:   "build",
	Short: "Build the project",
	Long:  "Package the project files and generate the deployable .plasmoid archive.",
	Run: func(cmd *cobra.Command, args []string) {
		if err := BuildPlasmoid(); err != nil {
			color.Red(err.Error())
		}
	},
}

buildCmd represents the build command

Functions

func BuildPlasmoid

func BuildPlasmoid() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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