change
This commit is contained in:
parent
2416e80407
commit
cfc797395a
|
|
@ -30,7 +30,7 @@ class MirrorsController < ApplicationController
|
|||
elsif !shell_clone && Dir.exist?("#{path}/#{image_repo_name}")
|
||||
system("rm -rf #{path}/#{image_repo_name}")
|
||||
new_shell_clone = system("cd #{path} && git clone #{image_url}")
|
||||
Rails.logger.info("shell_clone cd #{path} && git clone #{image_url}: #{new_shell_clone} -- for again")
|
||||
Rails.logger.info("new_shell_clone cd #{path} && git clone #{image_url}: #{new_shell_clone} -- for again")
|
||||
if new_shell_clone
|
||||
render json: {status: 0, message: "re_clone_success"}
|
||||
else
|
||||
|
|
@ -99,6 +99,15 @@ class MirrorsController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
def delete_repo
|
||||
path = params[:path]
|
||||
image_repo_name = params[:repo_name]
|
||||
if Dir.exist?("#{path}/#{image_repo_name}")
|
||||
system("rm -rf #{path}/#{image_repo_name}")
|
||||
end
|
||||
render json: {status: 1, message: "delete_sucess"}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_token
|
||||
|
|
|
|||
|
|
@ -2,4 +2,5 @@ Rails.application.routes.draw do
|
|||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
||||
get "mirrors/clone", to: "mirrors#clone"
|
||||
get "mirrors/push", to: "mirrors#push"
|
||||
get "mirrors/delete_repo", to: "mirrors#delete_repo"
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue