|
|
@ -426,12 +426,12 @@ class GamesController < ApplicationController
|
|
|
|
game_code = GameCode.where(:game_id => @game.try(:id), :path => path).first
|
|
|
|
game_code = GameCode.where(:game_id => @game.try(:id), :path => path).first
|
|
|
|
if game_code.present?
|
|
|
|
if game_code.present?
|
|
|
|
content = game_code.try(:new_code)
|
|
|
|
content = game_code.try(:new_code)
|
|
|
|
@content = if @myshixun.mirror_name.select{|a| a.include?("MachineLearning") || a.include?("Python")}.present? && content.present?
|
|
|
|
# @content = if @myshixun.mirror_name.select{|a| a.include?("MachineLearning") || a.include?("Python")}.present? && content.present?
|
|
|
|
content.gsub(/\t/, ' ')
|
|
|
|
# content.gsub(/\t/, ' ')
|
|
|
|
else
|
|
|
|
# else
|
|
|
|
content
|
|
|
|
# content
|
|
|
|
end
|
|
|
|
# end
|
|
|
|
update_file_content(@content, @myshixun.repo_path, path, current_user.mail, current_user.full_name, "game passed reset")
|
|
|
|
update_file_content(content, @myshixun.repo_path, path, current_user.mail, current_user.full_name, "game passed reset")
|
|
|
|
else
|
|
|
|
else
|
|
|
|
tip_exception("代码重置失败,代码为空")
|
|
|
|
tip_exception("代码重置失败,代码为空")
|
|
|
|
end
|
|
|
|
end
|
|
|
|