From 5f7be30a2f2774b58b82c2712f4b4e0afecbe20b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 14 Apr 2014 10:47:01 +0200 Subject: [PATCH] [IMP] clarify initial instructions, autogen directory if does not exist --- doc/howto/howto_website.rst | 17 ++++++----------- openerpcommand/scaffold.py | 4 +++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/howto/howto_website.rst b/doc/howto/howto_website.rst index bb2d0ee5554..f4c2c7f6f47 100644 --- a/doc/howto/howto_website.rst +++ b/doc/howto/howto_website.rst @@ -20,20 +20,14 @@ Creating a basic module In OpenERP, doing things takes the form of creating modules, and these modules customize the behavior of the OpenERP installation. The first step is thus to -create a module: - -.. todo:: output directory probably shouldn't be ``.`` - -.. todo:: ``oe`` v ``./oe``? +create a module: at the command-line, go to your server's directory and enter .. code-block:: console - $ oe scaffold Academy . + $ ./oe scaffold Academy ../my-modules -.. patch:: - :hidden: - -This builds a basic module for you: +This will build a basic module for you in a directory called ``my-modules`` +right next to your server's directory: .. code-block:: text @@ -49,7 +43,8 @@ This builds a basic module for you: └── security └── ir.model.access.csv -Ignore anything in the ``models`` and ``security`` directories for now. +.. patch:: + :hidden: .. todo:: diff --git a/openerpcommand/scaffold.py b/openerpcommand/scaffold.py index 6af3bd9bbbd..4713f739306 100644 --- a/openerpcommand/scaffold.py +++ b/openerpcommand/scaffold.py @@ -120,8 +120,10 @@ def directory(p): expanded = os.path.abspath( os.path.expanduser( os.path.expandvars(p))) + if not os.path.exists(expanded): + os.makedirs(expanded) if not os.path.isdir(expanded): - die("Directory %s does not seem to exist" % p) + die("%s exists but is not a directory" % p) return expanded def die(message, code=1):