diff --git a/build-locate-id.sh b/Locate ID/build-locate-id.sh similarity index 74% rename from build-locate-id.sh rename to Locate ID/build-locate-id.sh index 6460d2e..a22405f 100755 --- a/build-locate-id.sh +++ b/Locate ID/build-locate-id.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash + go mod download -package="$PWD/Locate ID/LocateID.go" +package="./LocateID.go" package_split=(${package//\// }) package_name="LocateID" @@ -15,11 +16,11 @@ do GOOS=${platform_split[0]} GOARCH=${platform_split[1]} output_name=$package_name'-'$GOOS'-'$GOARCH - if [ $GOOS = "windows" ]; then + if [ "$GOOS" = "windows" ]; then output_name+='.exe' fi - env GOOS=$GOOS GOARCH=$GOARCH GOPATH="$PWD/Locate ID/" go build -o "./Locate ID/build/$output_name" $package + env GOOS="$GOOS" GOARCH="$GOARCH" go build -o ./build/$output_name $package if [ $? -ne 0 ]; then echo 'An error has occurred! Aborting the script execution...' exit 1 diff --git a/build-id-parser.sh b/User ID Parser/build-id-parser.sh similarity index 73% rename from build-id-parser.sh rename to User ID Parser/build-id-parser.sh index 8f67a0f..18fb6b4 100755 --- a/build-id-parser.sh +++ b/User ID Parser/build-id-parser.sh @@ -2,7 +2,7 @@ go mod download -package="$PWD/User ID Parser/IdParser.go" +package="./IdParser.go" package_split=(${package//\// }) package_name="IdParser" @@ -15,11 +15,11 @@ do GOOS=${platform_split[0]} GOARCH=${platform_split[1]} output_name=$package_name'-'$GOOS'-'$GOARCH - if [ $GOOS = "windows" ]; then + if [ "$GOOS" = "windows" ]; then output_name+='.exe' fi - env GOOS=$GOOS GOARCH=$GOARCH GOPATH="$PWD/User ID Parser/" go build -o ./User ID Praser/build/$output_name $package + env GOOS="$GOOS" GOARCH=$GOARCH go build -o "./build/$output_name" $package if [ $? -ne 0 ]; then echo 'An error has occurred! Aborting the script execution...' exit 1