File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # git submodules
2+
3+ See https://github.com/github/octocatalog-diff/issues/88 for context.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This script is called from lib/octocatalog-diff/catalog-util/git.rb and is used to
4+ # archive and extract a certain branch of a git repository into a target directory.
5+
6+ if [ -z " $OCD_GIT_EXTRACT_BRANCH " ]; then
7+ echo " Error: Must declare OCD_GIT_EXTRACT_BRANCH"
8+ exit 255
9+ fi
10+
11+ if [ -z " $OCD_GIT_EXTRACT_TARGET " ]; then
12+ echo " Error: Must declare OCD_GIT_EXTRACT_TARGET"
13+ exit 255
14+ fi
15+
16+ set -euf -o pipefail
17+ git clone --single-branch -b " $OCD_GIT_EXTRACT_BRANCH " . " $OCD_GIT_EXTRACT_TARGET "
18+ ( cd " $OCD_GIT_EXTRACT_TARGET " && git submodule init && git submodule sync && git submodule update )
You can’t perform that action at this time.
0 commit comments