Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
careyjames committed Oct 12, 2023
1 parent 3923577 commit 6845dea
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
36 changes: 36 additions & 0 deletions bin/DNS-Scout/share/setup-api-token.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Detect the shell and choose the appropriate configuration file
shell_config_file=""
if [ "$SHELL" == "/bin/bash" ] || [ "$SHELL" == "/usr/bin/bash" ]; then
shell_config_file="$HOME/.bashrc"
elif [ "$SHELL" == "/bin/zsh" ] || [ "$SHELL" == "/usr/bin/zsh" ]; then
shell_config_file="$HOME/.zshrc"
else
echo "Unsupported shell. Exiting."
exit 1
fi

# Check if the API token is already set in the shell configuration file
if grep -q "export IPINFO_API_TOKEN=" $shell_config_file; then
echo "API token already set in $shell_config_file. Exiting."
exit 0
fi

# Prompt the user for the API token
read -p "Please enter your IPInfo API token: " api_token

# Check if the API token was entered
if [ -z "$api_token" ]; then
echo "API token is required. Exiting."
exit 1
fi

# Add the API token to the user's shell configuration file
echo "export IPINFO_API_TOKEN=$api_token" >> $shell_config_file

# Reload the shell configuration file to make the new environment variable available immediately
source $shell_config_file

# Print a success message
echo "API token successfully saved."
7 changes: 3 additions & 4 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
- uses: actions/setup-go@v2
with:
go-version: 1.21
modules-directory: src

# Make sure to install Go 1.21 before running this script
# or update the path to the Go binary accordingly.

# Step 1: Compile the Go code
echo "Compiling Go code..."
Expand Down
Binary file added bin/dns-scout
Binary file not shown.

0 comments on commit 6845dea

Please sign in to comment.