[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
packages.
--- a/cubicweb/devtools/devctl.py Mon Mar 20 14:39:22 2017 +0100
+++ b/cubicweb/devtools/devctl.py Mon Mar 20 12:13:04 2017 +0100
@@ -28,7 +28,7 @@
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 @@
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)
try:
mkdir(destdir)