lib/learn_open/opener.rb in learn-open-1.2.16 vs lib/learn_open/opener.rb in learn-open-1.2.17
- old
+ new
@@ -344,20 +344,27 @@
def cd_to_lesson
puts "Opening lesson..."
Dir.chdir("#{lessons_dir}/#{repo_dir}")
end
+ def pip_install
+ if !ios_lesson? && File.exists?("#{lessons_dir}/#{repo_dir}/requirements.txt")
+ puts "Installing pip dependencies..."
+ system("pip install -r requirements.txt")
+ end
+ end
+
def bundle_install
if !ios_lesson? && File.exists?("#{lessons_dir}/#{repo_dir}/Gemfile")
puts "Bundling..."
system("bundle install")
end
end
def npm_install
if !ios_lesson? && File.exists?("#{lessons_dir}/#{repo_dir}/package.json")
- puts 'Installing dependencies...'
+ puts 'Installing npm dependencies...'
if ide_environment?
system("yarn install --no-lockfile")
else
system("npm install")
@@ -445,9 +452,10 @@
end
def dependency_tasks
bundle_install
npm_install
+ pip_install
end
def restore_files
pid = Process.spawn("restore-lab", [:out, :err] => File::NULL)
Process.waitpid(pid)