File: dev.go

package info (click to toggle)
gittuf 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,692 kB
  • sloc: python: 85; makefile: 58; sh: 1
file content (18 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright The gittuf Authors
// SPDX-License-Identifier: Apache-2.0

package dev

import (
	"fmt"
	"os"
)

const DevModeKey = "GITTUF_DEV"

var ErrNotInDevMode = fmt.Errorf("this feature is only available in developer mode, and can potentially UNDERMINE repository security; override by setting %s=1", DevModeKey)

// InDevMode returns true if gittuf is currently in developer mode.
func InDevMode() bool {
	return os.Getenv(DevModeKey) == "1"
}