Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/smc_pyutil/smc_pyutil/first_steps.py
Views: 285
1
# This file is part of CoCalc: Copyright © 2023 Sagemath, Inc.
2
# License: AGPLv3 s.t. "Commons Clause" – read LICENSE.md for details
3
4
import os, shutil
5
6
def main():
7
path = os.path.join(os.environ['HOME'], 'first-steps')
8
if os.path.exists(path):
9
# nothing to do.
10
return
11
12
ext = os.path.splitext(path)[1].lower()
13
template = os.path.join(os.path.dirname(os.path.realpath(__file__)),
14
'templates', 'first-steps')
15
if os.path.exists(template):
16
shutil.copytree(template, path)
17
return
18
19
# No template found. Installation must be messed up badly.
20
raise RuntimeError("first steps template is not available")
21
22
23
if __name__ == "__main__":
24
main()
25
26