raykit 0.0.462 → 0.0.464
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/raykit/git/directory.rb +0 -10
- data/lib/raykit/git/repository.rb +10 -0
- data/lib/raykit.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e4a2d60ca424ebdb9000823856de5c8c6ae6ffc31b9a8946a86ec3570132e7
|
4
|
+
data.tar.gz: 9063a6a81a610d259378410074d6e682defa123dd15b7ea9804e6ebffe801295
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee69ff1a3ac6bc02e3feb48678d9e7d24b5745d0b810af1ef2daaebcfe3ff9d5d3354811180cc02fa851537babd94c8048f147f58d6cc4d020a65899ae162ee2
|
7
|
+
data.tar.gz: 4d1fe36adf299a5db6cdc50bfdf6d2224eae2271a8e8df42a4ec46192f8e58499e8b05f69aa1679331e04e4859ce0f446b91d7a7ad9c932d72d96f88647e9a0d
|
data/lib/raykit/git/directory.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
module Raykit
|
4
3
|
module Git
|
5
4
|
# Functionality to manage a local clone of a git repository
|
@@ -181,15 +180,6 @@ module Raykit
|
|
181
180
|
end
|
182
181
|
end
|
183
182
|
end
|
184
|
-
|
185
|
-
def backup
|
186
|
-
if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
|
187
|
-
puts "Backing up #{GIT_DIRECTORY.repository.url}"
|
188
|
-
Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
|
189
|
-
else
|
190
|
-
puts "Environment variable GIT_BACKUP_DIR is not set"
|
191
|
-
end
|
192
|
-
end
|
193
183
|
end
|
194
184
|
end
|
195
185
|
end
|
@@ -229,6 +229,16 @@ module Raykit
|
|
229
229
|
FileUtils.rm_rf(make_dir) if (cmd.exitstatus == 0)
|
230
230
|
cmd
|
231
231
|
end
|
232
|
+
|
233
|
+
def self.backup(url, backup_dir)
|
234
|
+
if (Dir.exist?(backup_dir))
|
235
|
+
Dir.chdir(backup_dir) do
|
236
|
+
run("git pull")
|
237
|
+
end
|
238
|
+
else
|
239
|
+
run("git clone #{url} \"#{backup_dir}\"")
|
240
|
+
end
|
241
|
+
end
|
232
242
|
end
|
233
243
|
end
|
234
244
|
end
|
data/lib/raykit.rb
CHANGED
@@ -16,6 +16,15 @@ SECRETS = Raykit::Secrets.new
|
|
16
16
|
REPOSITORIES = Raykit::Git::Repositories.new("#{Raykit::Environment.get_dev_dir("log")}/Raykit.Git.Repositories.json")
|
17
17
|
GIT_DIRECTORY = Raykit::Git::Directory.new(Rake.application.original_dir)
|
18
18
|
|
19
|
+
def backup_git_directory
|
20
|
+
if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
|
21
|
+
puts "Backing up #{GIT_DIRECTORY.repository.url}"
|
22
|
+
Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
|
23
|
+
else
|
24
|
+
puts "Environment variable GIT_BACKUP_DIR is not set"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
19
28
|
NUGET_DIR = Raykit::Environment::get_dev_dir("nuget")
|
20
29
|
PUBLISH_DIR = Raykit::Environment::get_dev_dir("publish")
|
21
30
|
|