headers

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const COPY_HEADER_TEMPLATE = "AUTO-GENERATED, DO NOT EDIT!\nPlease edit the original at %s"

template for the header

View Source
const LICENSE_TEMPLATE = "Copyright © %d Ory Corp Inc."

LICENSE defines the full license text.

View Source
const LICENSE_TOKEN = "Copyright ©"

LICENSE_TOKEN defines the token that identifies comments containing the license.

View Source
const ROOT_PATH = "https://github.com/ory/meta/blob/master/"

the root path for links to the original NOTE: might have to convert to a CLI switch

Variables

View Source
var Main = &cobra.Command{
	Use:   "headers",
	Short: "Adds language-specific headers to files",
}

Functions

func AddLicenses

func AddLicenses(dir string, year int) error

addLicenses adds or updates the Ory license header in all files within the given directory.

func CopyFile

func CopyFile(src, dst string) error

Header-aware equivalent of the Unix `cp` command. Copies the given source file (path must be relative to CWD) to the given absolute path and prepends the COPY_HEADER_TEMPLATE to the content.

func CopyFileNoOverwrite

func CopyFileNoOverwrite(src, dst string) error

Header-aware equivalent of the Unix `cp -n` command. Copies the given source file (path must be relative to CWD) to the given absolute path if the destination file does not exist and prepends the COPY_HEADER_TEMPLATE to the content.

func CopyFiles

func CopyFiles(src, dst string) error

Header-aware equivalent of the Unix `cp -r` command. Copies all files in the given `src` directory (path must be relative to CWD) to the given absolute path and prepends the COPY_HEADER_TEMPLATE to the content.

Types

This section is empty.

Directories

Path Synopsis
Package comments provides functionality to add and remove comments to the top of files.
Package comments provides functionality to add and remove comments to the top of files.

Jump to

Keyboard shortcuts

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