Skip to content

Commit

Permalink
Clone repositories instead of downloading zips
Browse files Browse the repository at this point in the history
In order to successfully build Python projects that rely on `setuptools_scm` for versioning
  • Loading branch information
gemenerik committed Nov 22, 2024
1 parent a715526 commit e73cca9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tools/build/download_docs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ function downloadGithubRepoDoc() {
if [ -d "${repoDir}" ]; then
echo "Seems as repo '${nameTag}' is already downloaded - skipping"
else
if [ -d "${unzipName}" ]; then
echo "Temporary directory '${unzipName}' already exists. Removing it to avoid conflicts."
rm -rf ${unzipName}
fi

mkdir -p ${tmp}
mkdir -p ${repoRootDir}

echo "Downloading repo ${nameTag}"
uri="https://github.com/bitcraze/${name}/archive/${tag}.zip"
curl -L -o ${downloadFile} ${uri}
unzip -q -d ${tmp} ${downloadFile}
rm ${downloadFile}
echo "Cloning repo ${nameTag}"
git clone --branch ${tag} --single-branch https://github.com/bitcraze/${name}.git ${unzipName}

if [ -f "${unzipName}/tools/build-docs/build-docs" ]; then
echo "Generating docs..."
Expand All @@ -41,7 +43,7 @@ function downloadGithubRepoDoc() {
mv ${unzipName}/docs ${repoDir}
rm -r ${unzipName}

# Massage data to move it into a namespace and genereate menus
# Massage data to move it into a namespace and generate menus
echo "Updating docs source files"
${scriptDir}/../docs/format_docs ${repoDir} ${ns} ${name} ${tag} ${repoRootUrl} ${repoDir}/_data/menu.yml ${dataDir}/docs_menu.yml ${dataDir}/docs_tag_list.yml ${directives}
fi
Expand Down

0 comments on commit e73cca9

Please sign in to comment.