mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 21:31:46 +00:00
Update init_engine262.sh to add the engine262 repository as a squashed subtree instead of a shallow submodule. Adjust usage comments, add existence check for the target directory, and update echo messages accordingly.
21 lines
684 B
Bash
Executable File
21 lines
684 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Add the engine262 repository as a git subtree (squashed)
|
|
# Usage: ./setup/init_engine262.sh
|
|
# This will add the repository at ./engine262 using a squashed subtree
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_URL="https://github.com/bendtherules/engine262"
|
|
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
TARGET_DIR="${REPO_ROOT}/engine262"
|
|
|
|
# Add the repository as a git subtree (squashed)
|
|
# If the target directory already exists, assume the subtree is present.
|
|
if [ ! -d "$TARGET_DIR" ]; then
|
|
git -C "${REPO_ROOT}" subtree add --prefix=engine262 "$REPO_URL" main --squash
|
|
else
|
|
echo "Subtree already present at $TARGET_DIR"
|
|
fi
|
|
|
|
echo "Subtree added and initialized at ./$TARGET_DIR"
|