Commit 8e9d665e authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

admin: Always use the same path to store compiled css

Either on production or development mode, store the compiled css under
static/css.
parent 3a479976
......@@ -139,7 +139,7 @@ def find_package_data(
return out
trigger_build = ["sdist", "build", "develop", "install"]
cmd = ''.join(sys.argv)
def compile_sass():
import subprocess
......@@ -158,28 +158,20 @@ def compile_sass():
if ret == 1:
raise Exception("gem install failed")
environment = "development" if "develop" in sys.argv else "production"
compass_bin = find_executable("compass")
compass_cmd = [compass_bin, "compile", css_dir, "-e"]
ret = subprocess.call(compass_cmd + ["production"])
compass_cmd = [compass_bin, "compile", css_dir,
"-e", environment, "--force"]
ret = subprocess.call(compass_cmd)
if ret == 1:
raise Exception("compass compile failed")
if "develop" in cmd:
ret = subprocess.call(compass_cmd + ["development"])
if ret == 1:
raise Exception("compass development compile failed")
if any(x in sys.argv for x in trigger_build):
if os.environ.get('SNFADMIN_AUTO_COMPILE', True) not in \
['False', 'false', '0']:
compile_sass()
if any(x in cmd for x in trigger_build):
if os.path.exists("./synnefo_admin/admin/static/min-css"):
print "The css files are already compiled in synnefo_admin/admin/static/min-css"
else:
if os.environ.get('SNFADMIN_AUTO_COMPILE', True) not in \
['False', 'false', '0']:
compile_sass()
setup(
name='snf-admin-app',
......
......@@ -5,9 +5,10 @@ http_path = "/"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
css_dir = "css"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :nested
# output_style = :nested
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
......@@ -22,13 +23,11 @@ output_style = :nested
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
if environment == :development
css_dir = "css"
line_comments = true
output_style = :nested
end
if environment == :production
css_dir = "min-css"
line_comments = false
output_style = :compressed
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment