Commit 6c847726 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[devtools] Create "newcube" in current directory by default

Instead of using "cubes path", which in many cases will be something wrong
(like <prefix>/share/cubicweb/cubes) now that cubes are regular Python

branch : 3.25
parent 4870e5a60a52
......@@ -28,7 +28,7 @@ import shutil
import tempfile
import sys
from datetime import datetime, date
from os import mkdir, chdir, path as osp
from os import getcwd, mkdir, chdir, path as osp
import pkg_resources
from warnings import warn
......@@ -691,13 +691,8 @@ layout, and a full featured cube with "full" layout.',
verbose = self.get('verbose')
destdir = self.get('directory')
if not destdir:
cubespath = ServerConfiguration.cubes_search_path()
if len(cubespath) > 1:
raise BadCommandUsage(
"can't guess directory where to put the new cube."
" Please specify it using the --directory option")
destdir = cubespath[0]
if not osp.isdir(destdir):
destdir = getcwd()
elif not osp.isdir(destdir):
print("-> creating cubes directory", destdir)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment