Skip to content

Commit

Permalink
Updating github-config
Browse files Browse the repository at this point in the history
  • Loading branch information
paketo-bot committed Mar 27, 2024
1 parent 32dee9c commit 0e2d817
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ function run::build() {

echo "Success!"

for name in detect build; do
names=("detect")

if [ -f "extension.toml" ]; then
names+=("generate")
else
names+=("build")
fi

for name in "${names[@]}"; do
printf "%s" "Linking ${name}... "

ln -sf "run" "${name}"
Expand All @@ -73,16 +81,20 @@ function cmd::build() {
for src in "${BUILDPACKDIR}"/cmd/*; do
name="$(basename "${src}")"

printf "%s" "Building ${name}... "
if [[ -f "${src}/main.go" ]]; then
printf "%s" "Building ${name}... "

GOOS="linux" \
CGO_ENABLED=0 \
go build \
-ldflags="-s -w" \
-o "${BUILDPACKDIR}/bin/${name}" \
"${src}/main.go"
GOOS="linux" \
CGO_ENABLED=0 \
go build \
-ldflags="-s -w" \
-o "${BUILDPACKDIR}/bin/${name}" \
"${src}/main.go"

echo "Success!"
echo "Success!"
else
printf "%s" "Skipping ${name}... "
fi
done
fi
}
Expand Down

0 comments on commit 0e2d817

Please sign in to comment.