Added receipts list
This commit is contained in:
@@ -6,6 +6,12 @@ Sequel.connect(cfg_internal.get_db)
|
||||
class Repos < Sequel::Model(:repos)
|
||||
end
|
||||
|
||||
class Recips < Sequel::Model(:recips)
|
||||
end
|
||||
|
||||
class RepocRecips < Sequel::Model(:repos_recips)
|
||||
end
|
||||
|
||||
class DBase
|
||||
attr :error, :last_id
|
||||
|
||||
@@ -24,4 +30,11 @@ class DBase
|
||||
def get_repo_info_by_name(repo_name)
|
||||
Repos.where(reponame: repo_name)
|
||||
end
|
||||
|
||||
def get_recips()
|
||||
result = []
|
||||
Recips.order(:id).map do |item|
|
||||
{ :fname => item[:filepath], :descr => item[:descr], :id => item[:id] }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -138,4 +138,14 @@ class GitRepo
|
||||
info[:error] = @error
|
||||
info
|
||||
end
|
||||
|
||||
def delete_repo(reponame)
|
||||
git_path = File.expand_path(reponame + ".git", @path)
|
||||
File.open("locks/gitcreate", "r") do |f|
|
||||
f.flock(File::LOCK_EX)
|
||||
if File.exist?(git_path)
|
||||
FileUtils.rm_rf(git_path, secure: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user