
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand

class InstallCommand(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option(
            "-t",
            "--target",
            dest="target_dir",
            default='~/.cookiejar',
            help='Project Templates directory.',
            metavar="TEMPLATES_DIR"
        ),
    )

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'install: Installs a Project Template.'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} ACTION [OPTIONS]'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        src = args[0]
        tgt = options.get('target_dir')

        manager = TemplateManager()
        manager.install(src=src, dest=tgt)


from optparse import make_option
from optparse import OptionParser
from scaffolder import get_minion_path
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand

class InstallCommand(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option(
            "-t",
            "--target",
            dest="target_dir",
            default=get_minion_path('weaver'),
            help='Project Templates directory.',
            metavar="TEMPLATES_DIR"
        ),
    )

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'install: Installs a Project Template.'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} ACTION [OPTIONS]'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        src = args[0]
        tgt = options.get('target_dir')

        manager = TemplateManager()
        manager.install(src=src, dest=tgt)

Use get_minion_path to get default dir.
InstallCommand: Use get_minion_path to get default dir.

  
  from optparse import make_option
  from optparse import OptionParser
+ from scaffolder import get_minion_path
  from scaffolder.core.template import TemplateManager
  from scaffolder.core.commands import BaseCommand
  
  class InstallCommand(BaseCommand):
      option_list = BaseCommand.option_list + (
          make_option(
              "-t",
              "--target",
              dest="target_dir",
-             default='~/.cookiejar',
+             default=get_minion_path('weaver'),
              help='Project Templates directory.',
              metavar="TEMPLATES_DIR"
          ),
      )
  
      def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
          help = 'install: Installs a Project Template.'
          parser = OptionParser(
              version=self.get_version(),
              option_list=self.get_option_list(),
              usage='\n  %prog {0} ACTION [OPTIONS]'.format(name)
          )
          aliases = ('tmp',)
          BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)
  
      def run(self, *args, **options):
          src = args[0]
          tgt = options.get('target_dir')
  
          manager = TemplateManager()
          manager.install(src=src, dest=tgt)
  
Use get_minion_path to get default dir.
## Code Before:

from optparse import make_option
from optparse import OptionParser
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand

class InstallCommand(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option(
            "-t",
            "--target",
            dest="target_dir",
            default='~/.cookiejar',
            help='Project Templates directory.',
            metavar="TEMPLATES_DIR"
        ),
    )

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'install: Installs a Project Template.'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} ACTION [OPTIONS]'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        src = args[0]
        tgt = options.get('target_dir')

        manager = TemplateManager()
        manager.install(src=src, dest=tgt)

## Instruction:
Use get_minion_path to get default dir.
## Code After:

from optparse import make_option
from optparse import OptionParser
from scaffolder import get_minion_path
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand

class InstallCommand(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option(
            "-t",
            "--target",
            dest="target_dir",
            default=get_minion_path('weaver'),
            help='Project Templates directory.',
            metavar="TEMPLATES_DIR"
        ),
    )

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'install: Installs a Project Template.'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} ACTION [OPTIONS]'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        src = args[0]
        tgt = options.get('target_dir')

        manager = TemplateManager()
        manager.install(src=src, dest=tgt)
