buildutils

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MPL-2.0 Imports: 9 Imported by: 2

README

= buildutils

image:https://pkg.go.dev/badge/github.com/DavidGamba/dgtools/buildutils.svg[Go Reference, link="https://pkg.go.dev/github.com/DavidGamba/dgtools/buildutils"] link:buildutils[] - Provides functions used when writing build automation.

Documentation

Overview

Package buildutils provides functions used when writing build automation.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

func CDGitRepoRoot

func CDGitRepoRoot() error

CDGitRepoRoot - Chdir to the Git repository root directory

func FindFileUpwards added in v0.3.0

func FindFileUpwards(ctx context.Context, filename string) (string, error)

FindFileUpwards - traverses the file system upwards looking for a file Returns buildutils.ErrNotFound if the file is not found

func GetFileFromURL

func GetFileFromURL(url, outputFilename string) error

func GitRepoName

func GitRepoName() (string, error)

GitRepoName - Gets the Git repository name by parsing the origin URL

func GitRepoRoot

func GitRepoRoot() (string, error)

GitRepoRoot - Gets the Git repository root directory

func GoModDir added in v0.2.0

func GoModDir() (string, error)

GoModDir - Gets the Go module directory, the root of the Go project.

func Touch added in v0.4.0

func Touch(filename string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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