Added license checker
This commit is contained in:
23
tooling/license/license.sh
Normal file
23
tooling/license/license.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$NODE_ENV" = "production" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
GIT_USER=$(git config user.name)
|
||||
GIT_EMAIL=$(git config user.email)
|
||||
|
||||
if [ -z "$GIT_USER" ]; then
|
||||
echo "Please set the git user name with the command 'git config user.name <username>'. The username needs to match the username in your Makerkit organization."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X GET "https://makerkit.dev/api/license/check?username=$GIT_USER&email=$GIT_EMAIL")
|
||||
|
||||
if [ "$STATUS_CODE" = "200" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user