summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Anderson2012-12-01 06:40:42 (GMT)
committer Greg Anderson2012-12-01 06:40:42 (GMT)
commit6e825767bc82c97ada5eff698d7c78c8ded270ea (patch)
tree56666ae6877a8f5f166a1e30add0fd1d2353b86e
parent5164de9e6ab6e60b02fcf0e3da97dd4de74aeb36 (diff)
Make site selection more robust
-rw-r--r--iq.drush.inc38
1 files changed, 19 insertions, 19 deletions
diff --git a/iq.drush.inc b/iq.drush.inc
index 3bb3968..4c7acbd 100644
--- a/iq.drush.inc
+++ b/iq.drush.inc
@@ -565,23 +565,23 @@ function drush_iq_apply_patch($number) {
}
}
$result = drush_shell_exec_interactive('patch -Np%d --batch -d %s -i %s', $strip_count, $project_dir, $filename);
- if (!drush_get_option('no-commit', FALSE)) {
- $commit_comment = _drush_iq_create_commit_comment($issue_info, drush_get_option('committer', FALSE), drush_get_option('message', FALSE));
- // TODO: can we easily ignore *.patch, etc., or easily add only modified files?
- $result = drush_shell_exec("git add .");
- if (dirname($filename) == $project_dir) {
- $result = drush_shell_exec("git rm --cached -- %s", basename($filename));
- if ($keep_patch) {
- $result = drush_shell_exec("git rm --cached -- %s", basename($keep_patch));
- }
- }
- if (array_key_exists('patchAuthorCredit', $issue_info)) {
- $result = drush_shell_exec("git commit --author=%s -m %s", $issue_info['patchAuthorCredit'], $commit_comment);
- }
- else {
- $result = drush_shell_exec("git commit -m %s", $commit_comment);
+ }
+ if (!drush_get_option('no-commit', FALSE)) {
+ $commit_comment = _drush_iq_create_commit_comment($issue_info, drush_get_option('committer', FALSE), drush_get_option('message', FALSE));
+ // Add the modified files
+ $result = drush_shell_exec("git add -A");
+ if (dirname($filename) == $project_dir) {
+ $result = drush_shell_exec("git rm --cached -- %s", basename($filename));
+ if ($keep_patch) {
+ $result = drush_shell_exec("git rm --cached -- %s", basename($keep_patch));
}
}
+ if (array_key_exists('patchAuthorCredit', $issue_info)) {
+ $result = drush_shell_exec("git commit --author=%s -m %s", $issue_info['patchAuthorCredit'], $commit_comment);
+ }
+ else {
+ $result = drush_shell_exec("git commit -m %s", $commit_comment);
+ }
}
drush_op('chdir', $cwd);
return $issue_info;
@@ -913,11 +913,8 @@ function _drush_iq_project_dir(&$issue_info) {
if (array_key_exists($project_name, $extension_info)) {
$result = drush_get_context('DRUSH_DRUPAL_ROOT', '') . '/' . dirname($extension_info[$project_name]->filename);
}
- else {
- drush_log(dt('Could not find the project directory under the bootstrapped site'));
- }
}
- elseif ($phase >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) {
+ if ($phase >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) {
$root = drush_get_context('DRUSH_DRUPAL_ROOT', FALSE);
if ($root) {
if ($project_name == 'drupal') {
@@ -937,6 +934,9 @@ function _drush_iq_project_dir(&$issue_info) {
if ($result) {
$issue_info['project-dir'] = $result;
}
+ else {
+ drush_log(dt('Could not find the project directory under the bootstrapped site'));
+ }
}
return $result;