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
packages.

--HG--
branch : 3.25
parent 4870e5a60a52
...@@ -28,7 +28,7 @@ import shutil ...@@ -28,7 +28,7 @@ import shutil
import tempfile import tempfile
import sys import sys
from datetime import datetime, date 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 import pkg_resources
from warnings import warn from warnings import warn
...@@ -691,13 +691,8 @@ layout, and a full featured cube with "full" layout.', ...@@ -691,13 +691,8 @@ layout, and a full featured cube with "full" layout.',
verbose = self.get('verbose') verbose = self.get('verbose')
destdir = self.get('directory') destdir = self.get('directory')
if not destdir: if not destdir:
cubespath = ServerConfiguration.cubes_search_path() destdir = getcwd()
if len(cubespath) > 1: elif not osp.isdir(destdir):
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):
print("-> creating cubes directory", destdir) print("-> creating cubes directory", destdir)
try: try:
mkdir(destdir) mkdir(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