Browse Source

Add additional standard path for tools.

Node.js tools may be installed in /usr/bin if installed by system
package tools or in ~/bin if installed by a default installation of npm.
main
Vincent Bernat 14 years ago
parent
commit
3df7a9f1b4
4 changed files with 14 additions and 8 deletions
  1. +2
    -1
      hyde/tests/ext/test_less.py
  2. +1
    -1
      hyde/tests/ext/test_optipng.py
  3. +5
    -3
      hyde/tests/ext/test_stylus.py
  4. +6
    -3
      hyde/tests/ext/test_uglify.py

+ 2
- 1
hyde/tests/ext/test_less.py View File

@@ -29,7 +29,8 @@ class TestLess(object):
def test_can_execute_less(self):
s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.less.LessCSSPlugin']
paths = ['/usr/local/share/npm/bin/lessc', '~/local/bin/lessc']
paths = ['/usr/local/share/npm/bin/lessc', '~/local/bin/lessc',
'/usr/bin/lessc', '~/bin/lessc']
less = [path for path in paths if File(path).exists]
if not less:
assert False, "Cannot find the lessc executable"


+ 1
- 1
hyde/tests/ext/test_optipng.py View File

@@ -31,7 +31,7 @@ class TestOptipng(object):
s = Site(TEST_SITE)
s.config.mode = "production"
s.config.plugins = ['hyde.ext.plugins.optipng.OptiPNGPlugin']
paths = ['/usr/local/bin/optipng']
paths = ['/usr/local/bin/optipng', '/usr/bin/optipng']
optipng = [path for path in paths if File(path).exists]
if not optipng:
assert False, "Cannot find the optipng executable"


+ 5
- 3
hyde/tests/ext/test_stylus.py View File

@@ -29,7 +29,8 @@ class TestLess(object):
def test_can_execute_stylus(self):
s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus',
'~/bin/stylus']
stylus = [path for path in paths if File(path).exists]
if not stylus:
assert False, "Cannot find the stylus executable"
@@ -53,7 +54,8 @@ class TestLess(object):
s = Site(TEST_SITE)
s.config.mode = "production"
s.config.plugins = ['hyde.ext.plugins.stylus.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus']
paths = ['/usr/local/share/npm/bin/stylus', '~/local/bin/stylus',
'~/bin/stylus']
stylus = [path for path in paths if File(path).exists]
if not stylus:
assert False, "Cannot find the stylus executable"
@@ -68,4 +70,4 @@ class TestLess(object):
assert target.exists
text = target.read_all()
expected_text = File(STYLUS_SOURCE.child('expected-site-compressed.css')).read_all()
assert text.strip() == expected_text.strip()
assert text.strip() == expected_text.strip()

+ 6
- 3
hyde/tests/ext/test_uglify.py View File

@@ -31,7 +31,8 @@ class TestLess(object):
s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin']
s.config.mode = "production"
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs']
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs',
'/usr/bin/uglifyjs', '~/bin/uglifyjs']
uglify = [path for path in paths if File(path).exists]
if not uglify:
assert False, "Cannot find the uglify executable"
@@ -52,7 +53,8 @@ class TestLess(object):
s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin']
s.config.mode = "production"
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs']
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs',
'/usr/bin/uglifyjs', '~/bin/uglifyjs']
uglify = [path for path in paths if File(path).exists]
if not uglify:
assert False, "Cannot find the uglify executable"
@@ -74,7 +76,8 @@ class TestLess(object):
s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.uglify.UglifyPlugin']
s.config.mode = "dev"
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs']
paths = ['/usr/local/share/npm/bin/uglifyjs', '~/local/bin/uglifyjs',
'/usr/bin/uglifyjs', '~/bin/uglifyjs']
uglify = [path for path in paths if File(path).exists]
if not uglify:
assert False, "Cannot find the uglify executable"


Loading…
Cancel
Save