Created
May 2, 2013 00:25
-
-
Save cafuego/5499387 to your computer and use it in GitHub Desktop.
Allow drush_make to keep a working-copy of a project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/drush_make.orig/drush_make.download.inc b/drush_make/drush_make.download.inc | |
index 92c68f9..2bd0bb5 100644 | |
--- a/drush_make.orig/drush_make.download.inc | |
+++ b/drush_make/drush_make.download.inc | |
@@ -345,6 +345,7 @@ function drush_make_download_post($name, $download, $download_location) { | |
function drush_make_download_git($name, $download, $download_location) { | |
$tmp_path = drush_make_tmp(); | |
$wc = drush_get_option('working-copy'); | |
+ $wc = (!empty($download['working-copy'])) ? $download['working-copy'] : $wc; | |
// check if branch option is set in info file, otherwise set default to master branch | |
$download['branch'] = isset($download['branch']) ? $download['branch'] : 'master'; | |
@@ -500,6 +501,10 @@ function drush_make_download_git($name, $download, $download_location) { | |
} | |
function drush_make_download_bzr($name, $download, $download_location) { | |
+ $wc = drush_get_option('working-copy'); | |
+ // Allow per-project working-copy to be specified in the Makefile. | |
+ $wc = (!empty($download['working-copy'])) ? $download['working-copy'] : $wc; | |
+ | |
$tmp_path = drush_make_tmp(); | |
$tmp_location = $tmp_path . '/__bzr__/' . basename($download_location); | |
drush_make_mkdir(dirname($tmp_location)); | |
@@ -517,7 +522,7 @@ function drush_make_download_bzr($name, $download, $download_location) { | |
$args[] = $download['revision']; | |
} | |
$command .= ' %s %s'; | |
- if (drush_get_option('working-copy')) { | |
+ if (!empty($wc)) { | |
$args[] = $download['url']; | |
$args[] = $tmp_location; | |
} | |
@@ -543,6 +548,10 @@ function drush_make_download_bzr($name, $download, $download_location) { | |
function drush_make_download_svn($name, $download, $download_location) { | |
+ $wc = drush_get_option('working-copy'); | |
+ // Allow per-project working-copy to be specified in the Makefile. | |
+ $wc = (!empty($download['working-copy'])) ? $download['working-copy'] : $wc; | |
+ | |
if (!empty($download['url'])) { | |
if (!empty($download['interactive'])) { | |
$function = 'drush_shell_exec_interactive'; | |
@@ -554,7 +563,7 @@ function drush_make_download_svn($name, $download, $download_location) { | |
if (!isset($download['force']) || $download['force']) { | |
$options = ' --force'; | |
} | |
- if (drush_get_option('working-copy')) { | |
+ if (!empty($wc)) { | |
$command = 'svn' . $options . ' checkout'; | |
} | |
else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment