Paths with spaces silently fail when using YUI Compressor (Mac OS X) #2

onecrayon opened this Issue May 25, 2009 · 1 comment


None yet
2 participants

If the path to the file to be compressed contains a space on Mac OS X, the YUI compressor step silently fails because the shell can't accept spaces in paths.

Replacing line 61 in with the code below fixes this, but there's surely a more graceful way to do this (additionally, the problem will affect any other command-line arguments used by Hyde, like those for HSS, and this step might not be necessary for all OSes or shells; I don't know much beyond bash, myself).

u"java -jar %s %s > %s" % (compress.replace(' ', '\ '), 
    resource.source_file.path.replace(' ', '\ '),
    tmp_file.path.replace(' ', '\ ')

At the very minimum, Hyde should print an error to the command line when generating a site that has spaces in its path to let the user know that YUI has failed to compress the file and why.

why not something like that ?
u'java -jar "%s" "%s" > "%s"' % (compress, resource.source_file.path, tmp_file.path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment