This repository has been archived by the owner on May 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
erus.drush.inc
83 lines (71 loc) · 1.78 KB
/
erus.drush.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* @file
* CTools Drush commands.
*/
/**
* Implements hook_drush_command().
*/
function erus_drush_command() {
$items = array();
$items['erus-up'] = array(
'aliases' => array('eup'),
'callback' => 'erus_drush_update',
'description' => 'Update all external update status modules with the latest recommended version.',
'examples' => array(
'drush eup' => 'Update all ERUS status modules.',
),
);
return $items;
}
/**
* Implementation of hook_drush_help().
*/
function erus_drush_help($section) {
switch ($section) {
case 'meta:erus:title':
return dt('Erus commands');
case 'meta:erus:summary':
return dt('Erus drush commands.');
}
}
/**
* A custom 'drush up' like command.
* @return [type] [description]
*/
function erus_drush_update() {
$version = drush_core_version();
if ($version < 6) {
drush_log("Your drush version is too old. Please update to version 6.", "error");
drush_user_abort();
return;
}
drush_invoke_process('@self', 'pm-updatestatus');
$continue = drush_confirm('Are you sure you want to continue with all updates?');
if (!$continue) {
drush_user_abort();
return;
}
$args = array();
$options = array('package-handler' => "erus_wget");
$return = drush_invoke_process('@self', 'pm-updatecode', $args, $options);
}
/**
* Implementation of hook_drush_engine_type_info().
*/
function erus_drush_engine_type_info() {
return array(
'package_handler' => array(
),
);
}
/**
* Used by dl and updatecode commands to determine how to download/checkout new projects and acquire updates to projects.
*/
function erus_drush_engine_package_handler() {
return array(
'erus_wget' => array(
'description' => 'Download project packages using wget or curl.',
),
);
}