Ronny Pfannschmidt avatar Ronny Pfannschmidt committed a878cdb

remove some duplicate code in the build command

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()
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.