mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
23 lines
644 B
Bash
Executable File
23 lines
644 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Run with ./scripts/build.sh <optional_version>
|
|
TELEMETRY_TOKEN=""
|
|
if ! [[ "$0" =~ scripts/build.sh ]]; then
|
|
echo "must be run from repository root"
|
|
exit 1
|
|
fi
|
|
|
|
if [ $# -eq 0 ] ; then
|
|
VERSION=`cat VERSION`
|
|
else
|
|
VERSION=$1
|
|
fi
|
|
|
|
# Set the CGO flags to use the portable version of BLST
|
|
#
|
|
# We use "export" here instead of just setting a bash variable because we need
|
|
# to pass this flag to all child processes spawned by the shell.
|
|
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
|
|
|
|
go build -v -ldflags="-X 'github.com/luxfi/cli/cmd.Version=$VERSION' -X github.com/luxfi/cli/pkg/utils.telemetryToken=$TELEMETRY_TOKEN" -o bin/lux
|