Documentation
¶
Index ¶
Constants ¶
const COMPANY_NAME = "Ory Corp"
const COPY_HEADER_TEMPLATE = "AUTO-GENERATED, DO NOT EDIT!\nPlease edit the original at %s"
template for the header
const HEADER_REGEXP = HEADER_TOKEN + `\s+(\d{4})\s+` + COMPANY_NAME
const HEADER_TEMPLATE_OPEN_SOURCE = HEADER_TOKEN + " %d " + COMPANY_NAME + "\nSPDX-License-Identifier: Apache-2.0"
HEADER_TEMPLATE_OPEN_SOURCE defines the full header text for open-source files.
const HEADER_TEMPLATE_PROPRIETARY = HEADER_TOKEN + " %d " + COMPANY_NAME + "\nProprietary and confidential.\nUnauthorized copying of this file is prohibited."
HEADER_TEMPLATE_PROPRIETARY defines the full header text for proprietary files.
const HEADER_TOKEN = "Copyright ©"
HEADER_TOKEN defines a text snippet to recognize an existing copyright header in a file.
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 ¶
var Main = &cobra.Command{
Use: "headers",
Short: "Adds language-specific headers to files",
}
Functions ¶
func AddHeaders ¶ added in v0.1.48
AddHeaders adds or updates the Ory copyright header in all applicable files within the given directory. Skips the file if any existing headers match `headerRegexp`
func CopyFile ¶
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 ¶
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.
Types ¶
This section is empty.