Skip to content

Commit b10daf9

Browse files
author
Mark Miesch
authored
Merge pull request #36 from JCSDA/develop
Hotfix for saber figures
2 parents 6b57979 + 33902fe commit b10daf9

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

docs/conf.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# import sys
2222
# sys.path.insert(0, os.path.abspath('.'))
2323

24-
2524
# -- General configuration ------------------------------------------------
2625

2726
# If your documentation needs a minimal Sphinx version, state it here.
@@ -172,4 +171,46 @@
172171
]
173172

174173

174+
# Workaround to install and execute git-lfs on Read the Docs
175+
import os
176+
import shutil
177+
gitLfsVersion = "2.11.0"
178+
if not shutil.which('git-lfs'):
179+
print("Need to install and initialize git lfs")
180+
tarFile = "git-lfs-linux-amd64-v" + gitLfsVersion + ".tar.gz"
181+
downLoadUrl = "https://github.com/git-lfs/git-lfs/releases/download/v" + \
182+
gitLfsVersion + "/" + tarFile
183+
print(" tar file: ", tarFile)
184+
print(" download URL: ", downLoadUrl)
185+
186+
# download git-lfs from github
187+
osCmd = "wget " + downLoadUrl
188+
os.system(osCmd)
189+
190+
# unpack the tar file
191+
osCmd = "tar xvzf " + tarFile
192+
os.system(osCmd)
193+
194+
# record the current working directory
195+
cwd = os.getcwd()
196+
197+
# make lfs available in current repository
198+
osCmd = cwd + "/git-lfs install"
199+
os.system(osCmd)
200+
201+
# configure for lfs processes
202+
osCmd = "git config filter.lfs.process '" + cwd + "/git-lfs filter-process'"
203+
os.system(osCmd)
204+
osCmd = "git config filter.lfs.smudge '" + cwd + "/git-lfs sumdge -- %f'"
205+
os.system(osCmd)
206+
osCmd = "git config filter.lfs.clean '" + cwd + "/git-lfs clean -- %f'"
207+
os.system(osCmd)
208+
209+
# download content from remote
210+
osCmd = cwd + "/git-lfs fetch"
211+
os.system(osCmd)
212+
213+
# replace local files (links) with their real content
214+
osCmd = cwd + "/git-lfs checkout"
215+
os.system(osCmd)
175216

0 commit comments

Comments
 (0)