Spaces:
Build error
Build error
David Li commited on
Commit ·
b65ee31
1
Parent(s): 0ccb779
fix: update system
Browse files- pages/utils/util.py +8 -0
pages/utils/util.py
CHANGED
|
@@ -9,6 +9,14 @@ def remove_existing_file(func):
|
|
| 9 |
sys.stdin = StringIO("y")
|
| 10 |
stream = os.popen('cd ~ && pwd')
|
| 11 |
root_dir = stream.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
sample_dir = root_dir.strip()
|
| 13 |
# remove /home/codespace/OpenBBUserData/exports/bbands.png already
|
| 14 |
# get last arg as export
|
|
|
|
| 9 |
sys.stdin = StringIO("y")
|
| 10 |
stream = os.popen('cd ~ && pwd')
|
| 11 |
root_dir = stream.read()
|
| 12 |
+
# check for .openbb_terminal/env in root_dir
|
| 13 |
+
if os.path.exists(os.path.join(root_dir.strip(), ".openbb_terminal", "env")) == False:
|
| 14 |
+
print("Did not find .openbb_terminal/env")
|
| 15 |
+
# create it
|
| 16 |
+
os.mkdir(os.path.join(root_dir.strip(), ".openbb_terminal"))
|
| 17 |
+
# make .env file
|
| 18 |
+
env_file = open(os.path.join(root_dir.strip(), ".openbb_terminal", "env"), "w")
|
| 19 |
+
|
| 20 |
sample_dir = root_dir.strip()
|
| 21 |
# remove /home/codespace/OpenBBUserData/exports/bbands.png already
|
| 22 |
# get last arg as export
|