cinful

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: BSD-3-Clause Imports: 4 Imported by: 2

README

cinful

Golang library and CLI to detect if a program is running in a CI system.

Pronounced "sinful" by mashing together CI, info, and the 'ful' suffix.

Originally ported from watson/ci-info and other links

as a CLI

prints details if in CI, otherwise nothing

cinful

cinful list # show all

Binaries are available on the releases page.

as a pkg
package main

import (
	"fmt"

	"github.com/hofstadter-io/cinful"
)

func main() {
	vendor := cinful.Info()
	if vendor != nil {
		fmt.Println(vendor)
	}
}

where

type Vendor struct {
	Name     string `json:"name,omitempty"`
	Constant string `json:"constant,omitempty"`
	Env      any    `json:"env,omitempty"`
	PR       any    `json:"pr,omitempty"`
	Val      string `json:"val,omitempty"`
}

Env will be a string after checking, but due to vendor differences, is a string, list, or map prior.

releasing

git must be clean first

release: goreleaser --rm-dist -p 1

snapshot (test): goreleaser --rm-dist -p 1 --snapshot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintVendors

func PrintVendors()

Types

type Vendor

type Vendor struct {
	Name     string `json:"name,omitempty"`
	Constant string `json:"constant,omitempty"`
	Env      any    `json:"env,omitempty"`
	PR       any    `json:"pr,omitempty"`
	Val      string `json:"val,omitempty"`
}

func Info

func Info() *Vendor

func (*Vendor) String

func (v *Vendor) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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