Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Issue forks
colorbox-3127345
Commits
a311896b
Commit
a311896b
authored
Apr 03, 2010
by
frjo
Browse files
#761206
: Update Drush commands for changes in Drush 3.
parent
db57cb24
Changes
1
Hide whitespace changes
Inline
Side-by-side
drush/colorbox.drush.inc
View file @
a311896b
...
...
@@ -31,7 +31,7 @@ function colorbox_drush_command() {
// the key in the $items array is the name of the command.
$items
[
'colorbox-script'
]
=
array
(
'callback'
=>
'
colorbox_
drush_colorbox_script'
,
'callback'
=>
'drush_colorbox_script'
,
'description'
=>
dt
(
"Downloads the Colorbox library."
),
'arguments'
=>
array
(
'path'
=>
dt
(
'Optional. A path where to install the Colorbox library. If omitted Drush will use the default location.'
),
...
...
@@ -71,7 +71,7 @@ function colorbox_drush_help($section) {
* To print something to the terminal window, use drush_print().
*
*/
function
colorbox_
drush_colorbox_script
()
{
function
drush_colorbox_script
()
{
$args
=
func_get_args
();
if
(
$args
[
0
])
{
$path
=
$args
[
0
];
...
...
@@ -80,16 +80,22 @@ function colorbox_drush_colorbox_script() {
$path
=
'sites/all/libraries'
;
}
// Create the path if it does not exist.
if
(
!
is_dir
(
$path
))
{
drush_op
(
'mkdir'
,
$path
);
drush_log
(
dt
(
'Directory @path was created'
,
array
(
'@path'
=>
$path
)),
'notice'
);
}
// Set the directory to the download location.
$olddir
=
getcwd
();
chdir
(
$path
);
$filename
=
basename
(
COLORBOX_DOWNLOAD_URI
);
$dirname
=
basename
(
COLORBOX_DOWNLOAD_URI
,
"
.zip
"
);
$dirname
=
basename
(
COLORBOX_DOWNLOAD_URI
,
'
.zip
'
);
// Remove any existing Colorbox library directory
if
(
is_dir
(
$dirname
))
{
drush_log
(
dt
(
'A existing Colorbox library was overwritten
from
@path'
,
array
(
'@path'
=>
$path
)),
'notice'
);
drush_log
(
dt
(
'A existing Colorbox library was overwritten
at
@path'
,
array
(
'@path'
=>
$path
)),
'notice'
);
}
// Remove any existing Colorbox library zip archive
if
(
is_file
(
$filename
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment