From 5514594800157f73def938e6335ac2412bbe23a4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 11:00:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 1c8928d98..faf30cb90 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -265,7 +265,12 @@ class ShixunsController < ApplicationController project_fork(@new_shixun, @repo_path, current_user.login) ShixunMember.create!(:user_id => User.current.id, :shixun_id => @new_shixun.try(:id), :role => 1) - + # 如果是jupyter,先创建一个目录,为了挂载(因为后续数据集,开启Pod后环境在没销毁前,你上传数据集是挂载不上目录的,因此要先创建目录,方便中间层挂载) + if @new_shixun.is_jupyter? + folder = EduSetting.get('shixun_folder') + path = "#{folder}/#{@new_shixun.identifier}" + FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path) + end # 同步复制关卡 if @shixun.challenges.present? @shixun.challenges.each do |challenge|