forked from sagemath/sagenb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sdist
executable file
·36 lines (31 loc) · 1.08 KB
/
sdist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# Check whether "sage" can be run (i.e. whether it's in the PATH)
if ! sage -v >/dev/null; then
echo >&2 "Error: $0 requires 'sage' to be in your PATH"
echo >&2 "Maybe first call 'SAGE_ROOT/sage -sh'"
exit 1
fi
echo "Trying to commit changes (if any)..."
sage -hg commit
status=$?
if [ $status -eq 1 ]; then
# 'hg commit' returns 1 if there are no changes to commit...
echo "No changes to commit (not an error)"
elif [ $status -ne 0 ]; then
echo >&2 "Error: $0: Couldn't commit changes" \
"('hg commit' failed with exit code $status)"
exit 1
else
# $status == 0
echo "Successfully committed the changes"
fi
echo "Running 'python setup.py sdist'..."
sage -python setup.py sdist
if [ $? -ne 0 ]; then
echo >&2 "Error: $0: 'python setup.py sdist' failed"
exit 1
fi
echo "**********************************************************"
echo "* If this is an official SageNB release, don't forget to *"
echo "* push the changes to the public Mercurial repository. *"
echo "**********************************************************"