diff --git a/README.md b/README.md index 5c9cf39..a4452f1 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,9 @@ The Command Line Option ----------------------- The depender can also generate concatenated JavaScript files on the command line: + $ git submodule update --init + $ virtualenv env + $ env/bin/python django/setup.py develop $ env/bin/python django/src/depender/cli.py django/mootools/settings.py -R Core > mootools-core.js $ env/bin/python django/src/depender/cli.py django/mootools/settings.py -R More -E Core > mootools-more.js diff --git a/django/src/depender/cli.py b/django/src/depender/cli.py index c7c12cb..ecbdd0e 100644 --- a/django/src/depender/cli.py +++ b/django/src/depender/cli.py @@ -68,21 +68,25 @@ def get_arr(val): deps = dpdr.get_transitive_dependencies(required, excluded) files = dpdr.get_files(deps, excluded) - output = "//No files included for build" + outputs = [] if len(files) > 0: #TODO: add copyrights - output = u"" + output = "" output += "\n//This library: %s" % (" ".join(sys.argv),) output += "\n//Contents: " output += ", ".join([ i.package.key + ":" + i.shortname for i in files ]) output += "\n\n" + outputs.append(output) for f in files: - output += "// Begin: " + f.shortname + "\n" - output += f.content + u"\n\n" + outputs.append("// Begin: " + f.shortname + "\n") + outputs.append(f.content.encode('utf-8')) + outputs.append("\n\n") + else: + outputs.append("//No files included for build") - print output + print "".join(outputs) def main(): usage = "usage: %prog settings.py [options]"