|
|
@ -264,11 +264,13 @@ class MyshixunsController < ApplicationController
|
|
|
|
unless @hide_code || (@myshixun.shixun&.vnc_evaluate && params[:evaluate].present?)
|
|
|
|
unless @hide_code || (@myshixun.shixun&.vnc_evaluate && params[:evaluate].present?)
|
|
|
|
# 远程版本库文件内容
|
|
|
|
# 远程版本库文件内容
|
|
|
|
last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"]
|
|
|
|
last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"]
|
|
|
|
content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present?
|
|
|
|
|
|
|
|
params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格,在windows机器上带来的问题
|
|
|
|
content =
|
|
|
|
else
|
|
|
|
if python_file?(path)
|
|
|
|
params[:content]
|
|
|
|
params[:content].gsub(/\t/, ' ').gsub(/ /, ' ')
|
|
|
|
end
|
|
|
|
else
|
|
|
|
|
|
|
|
params[:content]
|
|
|
|
|
|
|
|
end
|
|
|
|
uid_logger_dubug("###11222333####{content}")
|
|
|
|
uid_logger_dubug("###11222333####{content}")
|
|
|
|
uid_logger_dubug("###222333####{last_content}")
|
|
|
|
uid_logger_dubug("###222333####{last_content}")
|
|
|
|
|
|
|
|
|
|
|
@ -374,4 +376,9 @@ class MyshixunsController < ApplicationController
|
|
|
|
@repo_path = @myshixun.try(:repo_path)
|
|
|
|
@repo_path = @myshixun.try(:repo_path)
|
|
|
|
@path = params[:path]
|
|
|
|
@path = params[:path]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def python_file?(path)
|
|
|
|
|
|
|
|
false if path.blank?
|
|
|
|
|
|
|
|
path.to_s.split(".").last.downcase == "py"
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|