Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes the build folder name creation #1102

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading