Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.journal/
.wt/
/networking/
/aws/

# Moon
.moon/cache/
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ installed correctly.

## Sub-repository workflow

This is a meta repository. Directories cloned by `init.sh`, such as `networking/`, are independent Git repositories. They are ignored here and are not submodules.
This is a meta repository. Directories cloned by `init.sh`, including `networking/` and `aws/`, are independent Git repositories. They are ignored here and are not submodules.

For work inside a sub-repository:

Expand Down
27 changes: 17 additions & 10 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@
set -euo pipefail

root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
target="$root/networking"

if [[ -d "$target/.git" ]]; then
echo "networking is already cloned"
exit 0
fi
clone_repo() {
local name="$1"
local target="$root/$name"

if [[ -e "$target" ]]; then
echo "error: $target exists but is not a Git repository" >&2
exit 1
fi
if [[ -d "$target/.git" ]]; then
echo "$name is already cloned"
return
fi

git clone git@github.com:GilmanLab/networking.git "$target"
if [[ -e "$target" ]]; then
echo "error: $target exists but is not a Git repository" >&2
exit 1
fi

git clone "git@github.com:GilmanLab/$name.git" "$target"
}

clone_repo networking
clone_repo aws