diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 6a9438a79..c8f2f5f57 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -214,7 +214,15 @@ class SubjectsController < ApplicationController GitService.add_repository(repo_path: repo_path) # todo: 为什么保存的时候要去除后面的.git呢?? @shixun.update_column(:repo_name, repo_path.split(".")[0]) - mirror_id = MirrorRepository.find_by(type_name: 'Python3.6')&.id + mirror_id = + if @shixun.is_jupyter? + MirrorRepository.where("type_name like '%Jupyter%'").first&.id + folder = EduSetting.get('shixun_folder') + path = "#{folder}/#{identifier}" + FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path) + else + MirrorRepository.find_by(type_name: 'Python3.6')&.id + end if mirror_id ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) @shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)