Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions cms/startup.py

This file was deleted.

1 change: 1 addition & 0 deletions cms/startup.py
12 changes: 12 additions & 0 deletions rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ REPORT_DIR = File.join(REPO_ROOT, "reports")

# Environment constants
SERVICE_VARIANT = ENV['SERVICE_VARIANT']
# if service variant, honor that;
# - if not, pass the correct ENV tokens for lms or cms
if not SERVICE_VARIANT
# ignore command line environments, e.g. "rake e1=this"
clean_args = ARGV.delete_if { |x| /=/.match(x) }
# consider only the words remaining (parse out separators);
clean_args = clean_args.join(' ').split(/\W/)
# if lms or cms is among command line words, use it's env:
SERVICE_VARIANT = clean_args.include?('lms') ? "lms" :
(clean_args.include?('studio') or clean_args.include?('cms')) ? "cms" :
SERVICE_VARIANT
end
CONFIG_PREFIX = SERVICE_VARIANT ? SERVICE_VARIANT + "." : ""
ENV_FILE = File.join(ENV_ROOT, CONFIG_PREFIX + "env.json")
ENV_TOKENS = File.exists?(ENV_FILE) ? JSON.parse(File.read(ENV_FILE)) : {}
Expand Down
12 changes: 9 additions & 3 deletions rakelib/assets.rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Theming constants

USE_CUSTOM_THEME = ENV_TOKENS.has_key?('FEATURES') && ENV_TOKENS['FEATURES']['USE_CUSTOM_THEME']
if USE_CUSTOM_THEME
THEME_NAME = ENV_TOKENS['THEME_NAME']
Expand All @@ -23,17 +24,22 @@ def xmodule_cmd(watch=false, debug=false)
end

def coffee_cmd(watch=false, debug=false)
brew_paths = ["lms/", "cms/", "common/"]
if USE_CUSTOM_THEME
# put theme path first just to be safe;
brew_paths.unshift(THEME_ROOT)
end

if watch && Launchy::Application.new.host_os_family.darwin?
available_files = Process::getrlimit(:NOFILE)[0]
if available_files < MINIMAL_DARWIN_NOFILE_LIMIT
Process.setrlimit(:NOFILE, MINIMAL_DARWIN_NOFILE_LIMIT)

end
end
if watch
"node_modules/.bin/coffee --compile --watch lms/ cms/ common/"
"node_modules/.bin/coffee --compile --watch #{brew_paths.join(' ')}"
else
"node_modules/.bin/coffee --compile `find lms/ cms/ common/ -type f -name *.coffee` "
"node_modules/.bin/coffee --compile `find #{brew_paths.join(' ')} -type f -name *.coffee` "
end
end

Expand Down