From 2a01ebb1670e43c2e4d06d0f674869c994ae0a97 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 29 Nov 2025 01:22:12 +0000 Subject: [PATCH 01/10] windows helper --- .devcontainer/devcontainer.json | 2 +- .devcontainer/windows-host-helper.sh | 66 ++++++++++++++++++---------- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 77f5479d..d1dad8f3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -61,5 +61,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 876c1d76 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 533e70ad # spellchecker:disable-line } diff --git a/.devcontainer/windows-host-helper.sh b/.devcontainer/windows-host-helper.sh index b3d1d876..c7859169 100644 --- a/.devcontainer/windows-host-helper.sh +++ b/.devcontainer/windows-host-helper.sh @@ -7,7 +7,7 @@ # If you're still having issues, make sure in Windows Developer Settings that you enabled Developer Mode, and also that you set your git config to have `core.autocrlf=false` and `core.symlinks=true` globally -set -euo pipefail # Exit immediately on error +set -e # Exit immediately on error if [ -z "$BASH_VERSION" ]; then echo "Error: This script must be run with bash (e.g., 'bash windows-host-helper.sh')." >&2 @@ -28,8 +28,24 @@ repoName=$(basename "$gitUrl" .git) echo "Repo name extracted as '$repoName'" # Remove any existing subfolder with the repository name and recreate it -rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails -rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind +# Save mount information before unmounting (only for specific mount types) +mountInfoFile=$(mktemp) +mount | grep -E "$repoName/(\.pnpm-store|node_modules|\.venv)" > "$mountInfoFile" || true + +# Unmount only specific directories (.pnpm-store, node_modules, .venv) +echo "Checking for mounted directories..." +if [ -s "$mountInfoFile" ]; then + while IFS= read -r line; do + mountPath=$(echo "$line" | awk '{print $3}') + echo "Unmounting $mountPath..." + sudo umount "$mountPath" 2>/dev/null || sudo umount -l "$mountPath" 2>/dev/null || echo "Warning: Could not unmount $mountPath" + done < "$mountInfoFile" +else + echo "No specific mounts found to unmount." +fi + +sudo rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails +sudo rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind mkdir -p "./$repoName" # Create a temporary directory for cloning @@ -39,26 +55,32 @@ tmpdir=$(mktemp -d) # This creates "$tmpdir/$repoName" with the repository's contents. git clone "$gitUrl" "$tmpdir/$repoName" +# Enable dotglob so that '*' includes hidden files +shopt -s dotglob -SRC="$(realpath "$tmpdir/$repoName")" -DST="$(realpath "./$repoName")" - -# 1) Recreate directory tree under $DST -while IFS= read -r -d '' dir; do - rel="${dir#$SRC/}" # strip leading $SRC/ → e.g. "sub/dir" - mkdir -p "$DST/$rel" -done < <(find "$SRC" -type d -print0) - -# 2) Move all files into that mirror -while IFS= read -r -d '' file; do - rel="${file#$SRC/}" # e.g. "sub/dir/file.txt" - # ensure parent exists (though step 1 already did) - mkdir -p "$(dirname "$DST/$rel")" - mv "$file" "$DST/$rel" -done < <(find "$SRC" -type f -print0) +# Move all contents (including hidden files) from the cloned repo to the target folder +mv "$tmpdir/$repoName"/* "./$repoName/" -# 3) Clean up now‑empty dirs and the tmp clone -find "$SRC" -depth -type d -empty -delete +# Clean up: remove the temporary directory rm -rf "$tmpdir" -echo "Repository '$repoName' has been synced into '$DST'." +# Remount directories using saved mount information +echo "Remounting previously mounted directories..." +while IFS= read -r line; do + device=$(echo "$line" | awk '{print $1}') + mountPath=$(echo "$line" | awk '{print $3}') + fsType=$(echo "$line" | awk '{print $5}') + + if [ -d "$mountPath" ]; then + echo "Remounting $mountPath from $device..." + sudo mount -t "$fsType" "$device" "$mountPath" || echo "Warning: Failed to remount $mountPath" + else + echo "Creating and remounting $mountPath from $device..." + mkdir -p "$mountPath" + sudo mount -t "$fsType" "$device" "$mountPath" || echo "Warning: Failed to remount $mountPath" + fi +done < "$mountInfoFile" + +rm -f "$mountInfoFile" + +echo "Repository '$repoName' has been updated." From 10f99e678a8ca53e8d0dc37a236b6af9e7ffb56a Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 29 Nov 2025 01:22:28 +0000 Subject: [PATCH 02/10] whitespace --- template/.github/workflows/pre-commit.yaml.jinja-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.github/workflows/pre-commit.yaml.jinja-base b/template/.github/workflows/pre-commit.yaml.jinja-base index 5fb0cf11..1ed8ad96 100644 --- a/template/.github/workflows/pre-commit.yaml.jinja-base +++ b/template/.github/workflows/pre-commit.yaml.jinja-base @@ -69,4 +69,4 @@ jobs: {% endraw %}{{ gha_linux_runner }}{% raw %}-py${{ inputs.python-version }}-node-${{ inputs.node-version}}-${{ env.cache-name }}- - name: Run pre-commit - run: pre-commit run -a{% endraw %} + run: pre-commit run -a{% endraw %} From 77f0406704f824baa06c83fca65a84bcc5bdbd29 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 29 Nov 2025 01:26:35 +0000 Subject: [PATCH 03/10] conditional --- .devcontainer/devcontainer.json | 9 +++++++-- template/.devcontainer/devcontainer.json.jinja-base | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d1dad8f3..faa505ba 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,10 +3,15 @@ "service": "devcontainer", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "features": { - "ghcr.io/devcontainers/features/aws-cli:1.1.1": { + "ghcr.io/devcontainers/features/aws-cli:1.1.2": { // https://github.com/devcontainers/features/blob/main/src/aws-cli/devcontainer-feature.json // view latest version https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst - "version": "2.27.14" + "version": "2.32.6", + "customizations": { + "vscode": { + "extensions": [] // the AWS Toolkit extension seems to cause errors + } + } }, "ghcr.io/devcontainers/features/python:1.7.1": { // https://github.com/devcontainers/features/blob/main/src/python/devcontainer-feature.json diff --git a/template/.devcontainer/devcontainer.json.jinja-base b/template/.devcontainer/devcontainer.json.jinja-base index 2e88e236..f6505ff7 100644 --- a/template/.devcontainer/devcontainer.json.jinja-base +++ b/template/.devcontainer/devcontainer.json.jinja-base @@ -2,12 +2,17 @@ "dockerComposeFile": "docker-compose.yml", "service": "devcontainer", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", - "features": { + "features": {{% endraw %}{% if is_child_of_copier_base_template is not defined %}{% raw %} "ghcr.io/devcontainers/features/aws-cli:1.1.2": { // https://github.com/devcontainers/features/blob/main/src/aws-cli/devcontainer-feature.json // view latest version https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst - "version": "2.31.11" - }, + "version": "2.32.6", + "customizations": { + "vscode": { + "extensions": [] // the AWS Toolkit extension seems to cause errors + } + } + },{% endraw %}{% endif %}{% raw %} "ghcr.io/devcontainers/features/python:1.7.1": { // https://github.com/devcontainers/features/blob/main/src/python/devcontainer-feature.json "version": "{% endraw %}{{ python_version }}{% raw %}", From dac44285a2a9b35b33731a9917169c2d136b6287 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 29 Nov 2025 02:25:47 +0000 Subject: [PATCH 04/10] mac --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fa36212d..72004381 100644 --- a/.gitignore +++ b/.gitignore @@ -77,7 +77,6 @@ dist **/logs/*.log.* # macOS dev cleanliness -*.DS_Store -.DS_Store +**/.DS_Store # Ignores specific to this repository From f4f434a3958d6939f11af0ebf73854e6db19e18c Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 29 Nov 2025 14:21:40 +0000 Subject: [PATCH 05/10] fix aws --- .devcontainer/devcontainer.json | 8 ++------ template/.devcontainer/devcontainer.json.jinja-base | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index faa505ba..663891fa 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,12 +6,7 @@ "ghcr.io/devcontainers/features/aws-cli:1.1.2": { // https://github.com/devcontainers/features/blob/main/src/aws-cli/devcontainer-feature.json // view latest version https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst - "version": "2.32.6", - "customizations": { - "vscode": { - "extensions": [] // the AWS Toolkit extension seems to cause errors - } - } + "version": "2.32.6" }, "ghcr.io/devcontainers/features/python:1.7.1": { // https://github.com/devcontainers/features/blob/main/src/python/devcontainer-feature.json @@ -24,6 +19,7 @@ "vscode": { // Add the IDs of extensions you want installed when the container is created. "extensions": [ + "-AmazonWebServices.aws-toolkit-vscode", // the AWS CLI feature installs this automatically, but it's causing problems in VS Code // basic tooling // "eamodio.gitlens@15.5.1", "coderabbit.coderabbit-vscode@0.16.0", diff --git a/template/.devcontainer/devcontainer.json.jinja-base b/template/.devcontainer/devcontainer.json.jinja-base index f6505ff7..4a118dd6 100644 --- a/template/.devcontainer/devcontainer.json.jinja-base +++ b/template/.devcontainer/devcontainer.json.jinja-base @@ -7,11 +7,6 @@ // https://github.com/devcontainers/features/blob/main/src/aws-cli/devcontainer-feature.json // view latest version https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst "version": "2.32.6", - "customizations": { - "vscode": { - "extensions": [] // the AWS Toolkit extension seems to cause errors - } - } },{% endraw %}{% endif %}{% raw %} "ghcr.io/devcontainers/features/python:1.7.1": { // https://github.com/devcontainers/features/blob/main/src/python/devcontainer-feature.json @@ -29,7 +24,8 @@ "customizations": { "vscode": { // Add the IDs of extensions you want installed when the container is created. - "extensions": [ + "extensions": [{% endraw %}{% if is_child_of_copier_base_template is not defined %}{% raw %} + "-AmazonWebServices.aws-toolkit-vscode", // the AWS CLI feature installs this automatically, but it's causing problems in VS Code{% endraw %}{% endif %}{% raw %} // basic tooling // "eamodio.gitlens@15.5.1", "coderabbit.coderabbit-vscode@0.16.0", From 5d096172f6db020b7c1996e7e1aace19188951b7 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sun, 30 Nov 2025 13:19:18 +0000 Subject: [PATCH 06/10] short num --- .devcontainer/devcontainer.json | 2 +- .devcontainer/windows-host-helper.sh | 3 ++- template/.github/workflows/get-values.yaml.jinja-base | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 663891fa..ffd26800 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -62,5 +62,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 533e70ad # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 3e028363 # spellchecker:disable-line } diff --git a/.devcontainer/windows-host-helper.sh b/.devcontainer/windows-host-helper.sh index c7859169..9ae28ec4 100644 --- a/.devcontainer/windows-host-helper.sh +++ b/.devcontainer/windows-host-helper.sh @@ -30,7 +30,8 @@ echo "Repo name extracted as '$repoName'" # Remove any existing subfolder with the repository name and recreate it # Save mount information before unmounting (only for specific mount types) mountInfoFile=$(mktemp) -mount | grep -E "$repoName/(\.pnpm-store|node_modules|\.venv)" > "$mountInfoFile" || true +mount | grep -E "$repoName/(.*/)?(\.pnpm-store|node_modules|\.venv)" > "$mountInfoFile" || true +echo "Saved mount information to $mountInfoFile" # Unmount only specific directories (.pnpm-store, node_modules, .venv) echo "Checking for mounted directories..." diff --git a/template/.github/workflows/get-values.yaml.jinja-base b/template/.github/workflows/get-values.yaml.jinja-base index 1ae071ec..6304af3f 100644 --- a/template/.github/workflows/get-values.yaml.jinja-base +++ b/template/.github/workflows/get-values.yaml.jinja-base @@ -9,6 +9,9 @@ on: dependabot-commit-created: description: whether or not a commit was created on a dependabot branch value: ${{ jobs.get-values.outputs.dependabot-commit-created }} + pr-short-num: + description: the last two digits of the PR number (to be used for fixed width naming, like Pulumi stacks) + value: ${{ jobs.get-values.outputs.pr-short-num }} env: PYTHONUNBUFFERED: True From 0ee2ce546a05bb1b5e3468226b58cc8d1bca70e2 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sun, 30 Nov 2025 13:27:18 +0000 Subject: [PATCH 07/10] hash script --- .devcontainer/devcontainer.json | 2 +- src/hash_git_files.py | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ffd26800..d60497e4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -62,5 +62,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 3e028363 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): a0b47d6c # spellchecker:disable-line } diff --git a/src/hash_git_files.py b/src/hash_git_files.py index 1da0a3f7..40576d44 100644 --- a/src/hash_git_files.py +++ b/src/hash_git_files.py @@ -65,19 +65,16 @@ def compute_adler32(repo_path: Path, files: list[str]) -> int: if not chunk: break checksum = zlib.adler32(chunk, checksum) - except Exception as e: - if "[Errno 21] Is a directory" in str(e): - # Ignore symlinks that on windows sometimes get confused as being directories - continue - print(f"Error reading file {file}: {e}", file=sys.stderr) # noqa: T201 # this just runs as a simple script, so using print instead of log - raise + except IsADirectoryError: + # Ignore symlinks that on windows sometimes get confused as being directories + continue return checksum def find_devcontainer_hash_line(lines: list[str]) -> tuple[int, str | None]: """Find the line index and current hash in the devcontainer.json file.""" - for i in range(len(lines) - 1, -1, -1): + for i in reversed(range(len(lines))): if lines[i].strip() == "}": # Check the line above it if i > 0: From 361cdf508d69b3a2d46bc3ec8bfc7185c0eeec83 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Mon, 1 Dec 2025 11:34:19 +0000 Subject: [PATCH 08/10] more windows --- .devcontainer/devcontainer.json | 2 +- .devcontainer/windows-host-helper.sh | 63 ++++++++++++++++------------ 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d60497e4..7f4bf763 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -62,5 +62,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): a0b47d6c # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 46c9b0f7 # spellchecker:disable-line } diff --git a/.devcontainer/windows-host-helper.sh b/.devcontainer/windows-host-helper.sh index 9ae28ec4..820c28de 100644 --- a/.devcontainer/windows-host-helper.sh +++ b/.devcontainer/windows-host-helper.sh @@ -27,33 +27,33 @@ repoName=$(basename "$gitUrl" .git) echo "Repo name extracted as '$repoName'" -# Remove any existing subfolder with the repository name and recreate it -# Save mount information before unmounting (only for specific mount types) +# Save mount information (device, mount point, and filesystem type) mountInfoFile=$(mktemp) -mount | grep -E "$repoName/(.*/)?(\.pnpm-store|node_modules|\.venv)" > "$mountInfoFile" || true -echo "Saved mount information to $mountInfoFile" +mount | grep -E "$repoName/(.*/)?(\.pnpm-store|node_modules|\.venv)" | awk '{print $1 "|" $3 "|" $5}' > "$mountInfoFile" || true +echo "Saved mount information:" +cat "$mountInfoFile" -# Unmount only specific directories (.pnpm-store, node_modules, .venv) -echo "Checking for mounted directories..." +# Unmount specific directories (.pnpm-store, node_modules, .venv) +echo "Unmounting directories..." if [ -s "$mountInfoFile" ]; then - while IFS= read -r line; do - mountPath=$(echo "$line" | awk '{print $3}') - echo "Unmounting $mountPath..." - sudo umount "$mountPath" 2>/dev/null || sudo umount -l "$mountPath" 2>/dev/null || echo "Warning: Could not unmount $mountPath" + while IFS='|' read -r device mountPath fsType; do + if [ -n "$mountPath" ] && [ -d "$mountPath" ]; then + echo "Unmounting $mountPath..." + sudo umount "$mountPath" 2>/dev/null || sudo umount -l "$mountPath" 2>/dev/null || echo "Warning: Could not unmount $mountPath" + fi done < "$mountInfoFile" else - echo "No specific mounts found to unmount." + echo "No mounts found to unmount." fi -sudo rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails -sudo rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind +sudo rm -rf "./$repoName" || true +sudo rm -rf "./$repoName/*.md" mkdir -p "./$repoName" # Create a temporary directory for cloning tmpdir=$(mktemp -d) -# Clone the repository into a subfolder inside the temporary directory. -# This creates "$tmpdir/$repoName" with the repository's contents. +# Clone the repository git clone "$gitUrl" "$tmpdir/$repoName" # Enable dotglob so that '*' includes hidden files @@ -66,22 +66,31 @@ mv "$tmpdir/$repoName"/* "./$repoName/" rm -rf "$tmpdir" # Remount directories using saved mount information -echo "Remounting previously mounted directories..." -while IFS= read -r line; do - device=$(echo "$line" | awk '{print $1}') - mountPath=$(echo "$line" | awk '{print $3}') - fsType=$(echo "$line" | awk '{print $5}') - - if [ -d "$mountPath" ]; then - echo "Remounting $mountPath from $device..." - sudo mount -t "$fsType" "$device" "$mountPath" || echo "Warning: Failed to remount $mountPath" - else - echo "Creating and remounting $mountPath from $device..." +echo "Remounting directories..." +while IFS='|' read -r device mountPath fsType; do + if [ -n "$mountPath" ] && [ -n "$device" ]; then + echo "Recreating directory $mountPath..." mkdir -p "$mountPath" - sudo mount -t "$fsType" "$device" "$mountPath" || echo "Warning: Failed to remount $mountPath" + + echo "Remounting $device to $mountPath..." + sudo mount -t "$fsType" "$device" "$mountPath" && echo "Successfully remounted $mountPath" || echo "Warning: Failed to remount $mountPath" + + # Verify the mount worked correctly + if mount | grep -q "$mountPath"; then + echo "✓ Mount verified for $mountPath" + # Check if it has the wrong content (system folders instead of actual content) + if [ -d "$mountPath/data" ] && [ -d "$mountPath/isocache" ] && [ -d "$mountPath/lost+found" ]; then + echo "⚠ WARNING: $mountPath contains system folders (data/isocache/lost+found) - wrong volume mounted!" + echo " Device: $device" + echo " This volume may need to be deleted and recreated." + fi + else + echo "✗ Mount verification failed for $mountPath" + fi fi done < "$mountInfoFile" rm -f "$mountInfoFile" +echo "" echo "Repository '$repoName' has been updated." From 043bbc2132f7a1eb84e6c57a849000dbedf16d17 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Mon, 1 Dec 2025 11:42:52 +0000 Subject: [PATCH 09/10] rsync --- .devcontainer/devcontainer.json | 2 +- .devcontainer/windows-host-helper.sh | 65 +++++----------------------- 2 files changed, 13 insertions(+), 54 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7f4bf763..74c99cb5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -62,5 +62,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 46c9b0f7 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 5878af82 # spellchecker:disable-line } diff --git a/.devcontainer/windows-host-helper.sh b/.devcontainer/windows-host-helper.sh index 820c28de..f760b3bf 100644 --- a/.devcontainer/windows-host-helper.sh +++ b/.devcontainer/windows-host-helper.sh @@ -27,25 +27,6 @@ repoName=$(basename "$gitUrl" .git) echo "Repo name extracted as '$repoName'" -# Save mount information (device, mount point, and filesystem type) -mountInfoFile=$(mktemp) -mount | grep -E "$repoName/(.*/)?(\.pnpm-store|node_modules|\.venv)" | awk '{print $1 "|" $3 "|" $5}' > "$mountInfoFile" || true -echo "Saved mount information:" -cat "$mountInfoFile" - -# Unmount specific directories (.pnpm-store, node_modules, .venv) -echo "Unmounting directories..." -if [ -s "$mountInfoFile" ]; then - while IFS='|' read -r device mountPath fsType; do - if [ -n "$mountPath" ] && [ -d "$mountPath" ]; then - echo "Unmounting $mountPath..." - sudo umount "$mountPath" 2>/dev/null || sudo umount -l "$mountPath" 2>/dev/null || echo "Warning: Could not unmount $mountPath" - fi - done < "$mountInfoFile" -else - echo "No mounts found to unmount." -fi - sudo rm -rf "./$repoName" || true sudo rm -rf "./$repoName/*.md" mkdir -p "./$repoName" @@ -53,44 +34,22 @@ mkdir -p "./$repoName" # Create a temporary directory for cloning tmpdir=$(mktemp -d) -# Clone the repository +# Clone the repository into a subfolder inside the temporary directory git clone "$gitUrl" "$tmpdir/$repoName" -# Enable dotglob so that '*' includes hidden files -shopt -s dotglob - -# Move all contents (including hidden files) from the cloned repo to the target folder -mv "$tmpdir/$repoName"/* "./$repoName/" +# Use rsync to merge all contents (including hidden files) from cloned repo to target +# -a: archive mode (preserves permissions, timestamps, etc.) +# -v: verbose +# --exclude: skip volume mount directories that should not be overwritten +echo "Syncing repository contents..." +rsync -av \ + --exclude='node_modules' \ + --exclude='.pnpm-store' \ + --exclude='.venv' \ + "$tmpdir/$repoName/" "./$repoName/" # Clean up: remove the temporary directory rm -rf "$tmpdir" -# Remount directories using saved mount information -echo "Remounting directories..." -while IFS='|' read -r device mountPath fsType; do - if [ -n "$mountPath" ] && [ -n "$device" ]; then - echo "Recreating directory $mountPath..." - mkdir -p "$mountPath" - - echo "Remounting $device to $mountPath..." - sudo mount -t "$fsType" "$device" "$mountPath" && echo "Successfully remounted $mountPath" || echo "Warning: Failed to remount $mountPath" - - # Verify the mount worked correctly - if mount | grep -q "$mountPath"; then - echo "✓ Mount verified for $mountPath" - # Check if it has the wrong content (system folders instead of actual content) - if [ -d "$mountPath/data" ] && [ -d "$mountPath/isocache" ] && [ -d "$mountPath/lost+found" ]; then - echo "⚠ WARNING: $mountPath contains system folders (data/isocache/lost+found) - wrong volume mounted!" - echo " Device: $device" - echo " This volume may need to be deleted and recreated." - fi - else - echo "✗ Mount verification failed for $mountPath" - fi - fi -done < "$mountInfoFile" - -rm -f "$mountInfoFile" - -echo "" echo "Repository '$repoName' has been updated." +echo "Note: Volume mounts (node_modules, .pnpm-store, .venv) were preserved." From d009c10e980b56435c726a253db3fc54b562ca98 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Mon, 1 Dec 2025 11:57:48 +0000 Subject: [PATCH 10/10] pnpm --- extensions/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/context.py b/extensions/context.py index 97cd8c43..7b6b895c 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -17,7 +17,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: context["copier_version"] = "9.11.0" context["copier_template_extensions_version"] = "0.3.3" ####### - context["pnpm_version"] = "10.23.0" + context["pnpm_version"] = "10.24.0" # These are duplicated in the pyproject.toml of this repository context["pyright_version"] = "1.1.407" context["pytest_version"] = "9.0.1"