Skip to content

Commit 10938dd

Browse files
committed
Add error message when building from github zip files.
1 parent f65c0c9 commit 10938dd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/diffpy/SConscript.version

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,23 @@ env.Append(BUILDERS={'BuildFeaturesCode' :
5959

6060
vhpp = File('version.hpp')
6161

62+
MY_GIT_MISSING_ERROR_MSG = """
63+
Cannot determine libdiffpy version. Compile from a git repository
64+
or use a source archive from
65+
66+
https://github.com/diffpy/libdiffpy/releases
67+
"""
68+
6269
# If version.hpp exists do not use git
6370
if os.path.isfile(str(vhpp.srcnode())):
6471
majorminor = parsemajorminor(vhpp.srcnode().get_contents())
6572
else:
6673
from libdiffpybuildutils import gitinfo
6774
vtpl = File('version.tpl')
6875
ginfo = gitinfo()
76+
if not ginfo:
77+
print MY_GIT_MISSING_ERROR_MSG
78+
Exit(1)
6979
vhpp, = env.BuildVersionCode(['version.hpp'], vtpl)
7080
env.Depends(vhpp, env.Value(ginfo['version'] + ginfo['commit']))
7181
majorminor = (ginfo['major'], ginfo['minor'])

0 commit comments

Comments
 (0)