Skip to content

Commit

Permalink
fix: fixes the build folder name creation (#1102)
Browse files Browse the repository at this point in the history
* fix: fixes the build folder name creation

* fix: improves typing
  • Loading branch information
christopherferreira9 authored Oct 28, 2024
1 parent 9a6214e commit deb60fb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/build-static-dapps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ get_deployment_folder() {
else
local branch_name=""

echo "Debug: GITHUB_HEAD_REF = $GITHUB_HEAD_REF"
echo "Debug: GITHUB_REF = $GITHUB_REF"
echo "Debug: GITHUB_REF_NAME = $GITHUB_REF_NAME"
# Send debug messages to stderr instead of stdout
>&2 echo "Debug: GITHUB_HEAD_REF = $GITHUB_HEAD_REF"
>&2 echo "Debug: GITHUB_REF = $GITHUB_REF"
>&2 echo "Debug: GITHUB_REF_NAME = $GITHUB_REF_NAME"

if [ -n "$GITHUB_HEAD_REF" ]; then
# We're in a pull request
Expand All @@ -33,14 +34,14 @@ get_deployment_folder() {
# Last resort: use git command
branch_name=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch_name" = "HEAD" ]; then
echo "Error: Unable to determine branch name" >&2
>&2 echo "Error: Unable to determine branch name"
exit 1
fi
fi

echo "Debug: Determined branch_name = $branch_name"
>&2 echo "Debug: Determined branch_name = $branch_name"

# Replace slashes with hyphens in the branch name
# Only output the final result to stdout
echo "$branch_name" | sed 's/\//-/g'
fi
}
Expand Down Expand Up @@ -220,7 +221,7 @@ build_and_consolidate
echo "Copying built files to $deployment_dir"

# Update index.html
update_index_html "$deployment_dir/packages/examples" $deployment_folder
update_index_html "$deployment_dir/packages/examples" "$deployment_folder"

# Fetch the existing folders on the "gh-pages" branch and keep them as a list
existing_folders=$(git ls-tree -d --name-only origin/gh-pages)
Expand Down

0 comments on commit deb60fb

Please sign in to comment.