mageutil

package module
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 15 Imported by: 2

Documentation

Overview

Package mageutil provides utility functions for building AK

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTypeScript

func BuildTypeScript(baseDir, srcDir, destDir string) error

BuildTypeScript builds all .ts files in srcDir to .js files in destDir, as needed

func CopyFiles

func CopyFiles(paths map[string]string) error

CopyFiles paths with keys as source and values as destinations

func CopyInDir

func CopyInDir(destDir, srcDir string, files ...string) error

CopyInDir copies files from srcDir to destDir

func CopyRecursively

func CopyRecursively(destDir, srcDir string) error

CopyRecursively recursively copies srcDir to destDir

func DirGlob

func DirGlob(dir, glob string) ([]string, error)

DirGlob performs a glob operation on dir. The returned matches do not have dir as a prefix.

func GoProto

func GoProto(dest, src, out, opt string) error

GoProto builds .pb.go code from a .proto

func GoProtosInDir

func GoProtosInDir(dir, opt string) error

GoProtosInDir calls GoProto on all .proto files in dir

func HasExec

func HasExec(cmds ...string) error

HasExec returns an error if any of cmds don't satisfy exec.LookPath

func HasFiles

func HasFiles(files ...string) error

HasFiles returns an error if any of files don't exist

func Mkdir

func Mkdir(path string) error

Mkdir calls os.MkdirAll as needed to ensure a directory exists

func Newer

func Newer(paths map[string]string) (bool, error)

Newer considers paths as a map of file path keys to file path values. It returns true if any key path is newer than its corresponding value path.

func TSProtosInDir

func TSProtosInDir(destDir, srcDir string) error

TSProtosInDir creates _pb.js files in destDir for all .proto files in srcDir

func TinyGoProto added in v0.0.16

func TinyGoProto(
	dstPath string,
	srcPath string,
	includeDir string,
) error

func VerboseF

func VerboseF(tmpl string, args ...any)

VerboseF prints a message to stdout if mage is set to Verbose

func ZipDir

func ZipDir(inPath, outPath string) error

ZipDir writes a zip file containing all the files in inPath

func ZipFiles

func ZipFiles(out string, files map[string]string) error

ZipFiles creates a zip file including files where the keys are paths to files to include and values are how they should be named in the zip.

Types

This section is empty.

Jump to

Keyboard shortcuts

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