Commits

Ronny Pfannschmidt committed a878cdb

remove some duplicate code in the build command

  • Participants
  • Parent commits 73f020d

Comments (0)

Files changed (1)

kij/commands/build.py

 
 
 def build_command(config, queue):
-    build = config.source.ensure('build', dir=True)
+    build = config.source_directory.ensure('build', dir=True)
     build_lib = build.ensure('lib', dir=True)
     build_scripts = build.ensure('scripts-%s.%s' % VERSION_INFO, dir=True)
-    queue.add(Build(
-                   source=config.source,
-                   build_lib=build_lib,
-                   build_scripts=build_scripts,
-                   ))
+    task = Build(
+        source=config.source_directory,
+        build_lib=build_lib,
+        build_scripts=build_scripts,
+    )
+    queue.add(task)
 
 
 class BuildCommand(Command):
 
     def __call__(self, config):
         queue = Queue()
-        build = config.source_directory.ensure('build', dir=True)
-        build_lib = build.ensure('lib', dir=True)
-        build_scripts = build.ensure('scripts-%s.%s' % VERSION_INFO, dir=True)
-        task = Build(
-            source=config.source_directory,
-            build_lib=build_lib,
-            build_scripts=build_scripts,
-        )
-        queue.add(task)
+        build_command(config, queue)
         queue.run_all()