hem-tasks-rsync 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hem/tasks/rsync/deps.rb +47 -0
- data/lib/hem/tasks/rsync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f5b2bd358eb4a096dcace7cc3abebbd3a9911e
|
4
|
+
data.tar.gz: 0c9dcd68d8bd4a73291ad1bbdad8240c0bf1655d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ac7043b03dafe6d721297c4913b4eea15367ad04b606dbfa6925939b7a3f84c291cb153c7860795b7af9c0ba1c991ad459a0ba262a93d90d6256ed77b35433
|
7
|
+
data.tar.gz: 97d0bbcbc254d0f2b7b4c0262b33829e9031c5afa54a6c63717da3d528f131f90688352d04e92a9509bb5874c6bf044ecf3a83bff2b830d53a3cc39ffad987d2
|
data/lib/hem/tasks/rsync/deps.rb
CHANGED
@@ -5,6 +5,53 @@ before 'deps:composer', 'deps:sync:composer_files_to_guest'
|
|
5
5
|
after 'deps:composer', 'deps:sync:reload_or_sync'
|
6
6
|
|
7
7
|
namespace :deps do
|
8
|
+
desc 'Update composer dependencies'
|
9
|
+
argument :packages, optional: true, default: {}, as: Array
|
10
|
+
task :composer_update do |_task_name, args|
|
11
|
+
next unless File.exist? File.join(Hem.project_path, 'composer.json')
|
12
|
+
|
13
|
+
Rake::Task['tools:composer'].invoke
|
14
|
+
|
15
|
+
Rake::Task['deps:sync:composer_files_to_guest'].execute
|
16
|
+
|
17
|
+
packages = args[:packages].map(&:shellescape).join(' ')
|
18
|
+
|
19
|
+
Hem.ui.title 'Updating composer dependencies'
|
20
|
+
Dir.chdir Hem.project_path do
|
21
|
+
ansi = Hem.ui.supports_color? ? '--ansi' : ''
|
22
|
+
args = ["php bin/composer.phar update #{packages} #{ansi} --prefer-dist", { realtime: true, indent: 2 }]
|
23
|
+
complete = false
|
24
|
+
|
25
|
+
unless maybe(Hem.project_config.tasks.deps.composer.disable_host_run)
|
26
|
+
check = Hem::Lib::HostCheck.check(filter: /php_present/)
|
27
|
+
|
28
|
+
if check[:php_present] == :ok
|
29
|
+
begin
|
30
|
+
shell(*args)
|
31
|
+
|
32
|
+
Rake::Task['deps:sync:composer_files_to_guest'].execute
|
33
|
+
Rake::Task['vm:rsync_mount_sync'].execute
|
34
|
+
|
35
|
+
complete = true
|
36
|
+
rescue Hem::ExternalCommandError
|
37
|
+
Hem.ui.warning 'Updating composer dependencies locally failed!'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
unless complete
|
43
|
+
run(*args)
|
44
|
+
|
45
|
+
Rake::Task['deps:sync:composer_files_from_guest'].execute
|
46
|
+
Rake::Task['deps:sync:vendor_directory_from_guest'].execute
|
47
|
+
end
|
48
|
+
|
49
|
+
Hem.ui.success 'Composer dependencies updated'
|
50
|
+
end
|
51
|
+
|
52
|
+
Hem.ui.separator
|
53
|
+
end
|
54
|
+
|
8
55
|
desc 'Syncing dependencies to/from the VM'
|
9
56
|
namespace :sync do
|
10
57
|
desc 'Download the composer.json and lock from the guest to the host'
|