From f974ab7188b8ccb8bc4eebeaa9bb25c8bd7f17a1 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Fri, 27 Mar 2026 09:55:32 +0530 Subject: [PATCH] feat(setup): add script to add shallow engine262 submodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduces `setup/init_engine262.sh`, a Bash utility that clones the `engine262` repository as a shallow submodule (depth 1) into `./engine262`. The script adds the submodule, initializes it, and provides a usage comment. It ensures robust execution with `set -euo pipefail`. --- setup/init_engine262.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 setup/init_engine262.sh diff --git a/setup/init_engine262.sh b/setup/init_engine262.sh new file mode 100644 index 0000000..6d76e13 --- /dev/null +++ b/setup/init_engine262.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Shallow clone the engine262 repository as a git submodule +# Usage: ./add_engine_submodule.sh +# This will add the submodule at ./engine262 with a depth of 1 (shallow clone) + +set -euo pipefail + +REPO_URL="https://github.com/bendtherules/engine262" +TARGET_DIR="./engine262" + +# Add the submodule with shallow clone +git submodule add --depth 1 "$REPO_URL" "$TARGET_DIR" + +# Initialize and update the submodule (fetches the shallow copy) +git submodule update --init --depth 1 "$TARGET_DIR" + +echo "Submodule added and initialized at ./$TARGET_DIR"