Skip to content

Commit 2d730bd

Browse files
committed
Fixed using wrong directory
1 parent 084c225 commit 2d730bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

layersbox

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ def box_init(args):
186186
"""Initializes a LayersBox"""
187187
print("Initializing LayersBox...")
188188
dst = args.directory
189+
if not os.path.exists(dst):
190+
os.makedirs(dst)
189191
url = "THIS SHOULD HAVE BEEN REPLACED"
190192
try:
191193
url = read_url(dst)
192194
print("Found existing configuration, using URL https://{}/".format(url))
193195
except:
194196
url = raw_input("Enter the URL the box should be reachable at. (Don't put a / at the end)\nhttps://").strip("/")
195-
with open("common.env", 'w') as f:
197+
with open(join(dst, "common.env"), 'w') as f:
196198
f.write("LAYERS_API_URI=https://{}/\n".format(url))
197199
f.write("LAYERS_API_URL=https://{}/\n".format(url))
198200
f.write("LAYERS_APP_URI=https://{}/\n".format(url))

0 commit comments

Comments
 (0)