Files
coder/scripts/check_enterprise_imports.sh
Kyle Carberry 22e781eced chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00

24 lines
681 B
Bash
Executable File

#!/usr/bin/env bash
# This file checks all our AGPL licensed source files to be sure they don't
# import any enterprise licensed packages (the inverse is fine).
set -euo pipefail
# shellcheck source=scripts/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
cdroot
set +e
find . -regex ".*\.go" |
grep -v "./enterprise" |
grep -v ./scripts/auditdocgen/ --include="*.go" |
grep -v ./scripts/clidocgen/ --include="*.go" |
xargs grep -n "github.com/coder/coder/v2/enterprise"
# reverse the exit code because we want this script to fail if grep finds anything.
status=$?
set -e
if [ $status -eq 0 ]; then
error "AGPL code cannot import enterprise!"
fi
log "AGPL imports OK"