|
|
|
@ -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)
|
|
|
|
|