-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8 to master #2373
Closed
Closed
8 to master #2373
Changes from 219 commits
Commits
Show all changes
226 commits
Select commit
Hold shift + click to select a range
b64951c
Update Drush Compatibility matrix in the 8.x branch.
greg-1-anderson d8735de
Add branches list back to .travis.yml; select 8.x branch for testing.
greg-1-anderson 61f05cd
Add a branch regex that matches release tags, just in case Travis lim…
greg-1-anderson 97fd75f
Squashed commit of the following:
weitzman 67b5858
Progress on #2023. Recognize -dv and -vd in the Drush finder script.
weitzman 7f06b99
Handle spaces in /path/to/php for runserver command under Drupal 8.
weitzman ed4eb36
Fixes PATH export which was broken with commit 62b08fa
1cd67f8
Clean up @params in batch.inc
ElijahLynn 4ec7cec
Remove --file option form config-edit
weitzman b9186d4
Fix #2069. config-import --partial works at too low a level.
weitzman 7bbc539
Note a limitation of config-set.
weitzman 769b067
config-edit now calls into config-import command at end instead of ju…
weitzman e345ae5
Fix #2080. cutie specified wrong path for sqlite DB.
weitzman ddca1c7
Progress on #2090 - runserver/d8-rs-router.php can't find index.php a…
weitzman 48175f3
Add a shell alias example for saving a sanitized DB dump. #551
weitzman 0673167
Fix test expectation after D6 EOL.
weitzman 7c8e78e
Squashed commit of the following:
weitzman 55481ff
Polyfill for array_column() on PHP version 5.4 and lower.
weitzman 1b335a3
Fix test fail for config-import --partial. It uses a class only avail…
weitzman f96ab8b
Use a full directory in config-import --partial test.
weitzman a27d131
Handle and report on any errors when running the sanitize query.
weitzman cb01a8c
Replacing which with command test for better reliablity.
frederickjh 1230685
Drupal modules are recognized by the presence of an a .info.yml file,…
weitzman 5434952
D6/D7 modules ship with .info files, not .info.yml. Woops.
weitzman 13ca5c7
Addressing issue 2093 by appending basename($source_path) only if $so…
paulmer d9a8b62
Typo fix for config-edit description.
4610829
Add Doxygen to batch command callbacks.
weitzman 6315a3b
Fix typos; specify location of module hook implementations in sql_syn…
steveoliver fb1eacb
Use Drupal 8's batch.storage service when available in batch.inc
b8c7e87
D8 got rid of batch table.
weitzman ad9a564
D8 got rid of batch table (again).
weitzman 4dc7a85
D8 got rid of batch table (3rd try).
weitzman 80c3a0d
Allows custom locations to be included in make-lock files.
ncharalampidis 37af9e9
Add support for SSL MySQL connections
acrollet 4077750
Add encouragement to use Composer to examples/policy.drush.inc.
weitzman c504228
Refactor table selection options so that they can be shown on archive…
weitzman 117bbee
Now that Drupal 6 has reached EOL, -all- contrib modules on drupal.or…
greg-1-anderson 7aa7333
Ignore update_contrib in core requirements test for Drupal 6, since i…
greg-1-anderson ac24539
Mark pm-updatecode skipped on Drupal 6, as this command does not work…
greg-1-anderson 32c7393
Test php versions 5.4 and 7, instead of 5.5 and 7. This is in alignme…
greg-1-anderson cc75da0
Explicitly require symfony/console, so we can pin its version to ~2.7…
greg-1-anderson 30a4108
Do not run Drupal 8 tests with php 5.4.
greg-1-anderson be9785b
Merge pull request #2146 from drush-ops/fix-6
greg-1-anderson d14fce0
Provide annoted command support for Drush 8.
greg-1-anderson eb682b9
Fix up help output for annotated commands.
greg-1-anderson c1a2f63
Ensure that options are passed to the command.
greg-1-anderson e0157a4
Add tests for annotated commands.
greg-1-anderson fcb6887
Better handling and testing of help for annotation commands.
greg-1-anderson 965da88
Cache annotated commandfile discovery results.
greg-1-anderson 356fb75
Disable the woot module to avoid cross-contamination of the Drupal te…
greg-1-anderson 55593fa
Be a little more robust about disappearing annotation command files.
greg-1-anderson 7f9c69b
Support ignored-modules for annotated commands.
greg-1-anderson 84af0d3
Extract consolidation/annotated-command classes out for backport, to …
greg-1-anderson 8acb695
Annotated commands tests for Drupal 6.
greg-1-anderson dd66a85
Fix CommandInfo for php 5.4.
greg-1-anderson d06e80c
Prep for 8.1.0
weitzman 75ad3e1
Back to dev.
weitzman c3da343
Fix incorrect backport in runserver.
weitzman b06e66f
Add consolidation/output-formatters.
greg-1-anderson 95d10cf
Use consolidation/output-formatters with annotated commands, and upda…
greg-1-anderson d85429a
Update to annotated comands 1.0.0-beta8, and add a test for backend r…
greg-1-anderson b0b8eed
Factor annotationcommand_adapter_get_commands_for_commandhandler out …
greg-1-anderson c8a940b
Use modules' services file to find commandfile instances.
greg-1-anderson 7ff575b
Do a full bootstrap when running help, to ensure that the module serv…
greg-1-anderson d6efe71
Require a @command annotation for module service command methods, but…
greg-1-anderson fbef874
Fix #2151. Use leading slash when calling Drupal methods. Coding stan…
theodorosploumis a259b3f
Fix #2161. replace getStorageController() with getStorage().
weitzman 7dccc57
Fix #2170. config-import dependencies should be an array.
weitzman 4b00e31
Fix typo.
weitzman 85b5814
Prep for 8.1.2
weitzman b2a456b
Back to dev.
weitzman a356903
Merge pull request #1876 from matthijs-va/make-update-fixed-core
jhedstrom 4828b63
Do command discovery via tagged services rather than service parameters.
greg-1-anderson 439c478
Support --ignored-modules in tagged services.
greg-1-anderson 761299f
Check to see if DrupalKernel::addServiceModifier already exists; if s…
greg-1-anderson a70b79f
Update to consolidation/annotated-command 1.0.0-beta11.
greg-1-anderson ab0b099
Support symfony console commands. Note that we call Command::run() di…
greg-1-anderson 535c840
Do not rebuild the container; it does not appear to be necessary, and…
greg-1-anderson bc03759
Get rid of unnecessary cleanup in annotated command test.
greg-1-anderson 2690201
Add tests for Symfony Console commands and annotated Symfony Console …
greg-1-anderson c288ed8
Taking rebuild container out just caused other problems; perhaps $ker…
greg-1-anderson e1f8f77
Merge pull request #2139 from drush-ops/annotation-drush8
greg-1-anderson b80bc08
Update to consolidation/output-formatters 1.0.0-beta6
greg-1-anderson 58d4c13
Remove dead code. Use drush init instead.
weitzman bef7232
Fix #2176. Remove dependency on config module for config-import.
weitzman fb64860
Fix make tests, deprecate SVN support.
ergonlogic 6b92d01
Partial revert to fix make tests.
ergonlogic 14f2d7f
Fixed #2054: Document 'do_recursion' option in Drush Make.
ergonlogic 57b446d
Fixes #2189: Support 'no-core' tarballs for profile downloads.
ergonlogic cf7e32a
Add docs for 'variant' project parameter for Drush Make.
ergonlogic 04bba87
Don't recurse when we're using a pre-built profile tarball.
ergonlogic e0c9b5d
Fix fatal error when using --db-prefix (#2178)
rendered-monkey 83339d3
Mention --user defaults to 0 (#2201)
helmo bb14028
Fix #2198 - fix pointer regarding Composer.
weitzman 949009d
Test with devel-reinstall instead of devel-download.
greg-1-anderson 0fecd7f
Maintain compatibility with Drush extensions (e.g. drush_ctex_bonus) …
greg-1-anderson ef23255
Merge pull request #2212 from drush-ops/drush-log-compat-8.x
greg-1-anderson f91187f
Change sendmail_path to match drupal-composer. Hope this is more reli…
weitzman ee7f72c
Fix issue with included makefile on git repo. (#2238)
Decipher 2f49420
Fox typo.
weitzman 0fe1026
Add a new config-delete command. Useful for developers.
weitzman 2cb1a61
Fox another type and remove old code comment.
weitzman 95d9a68
Fox typo in code comment.
weitzman c69fd4d
Fixes #2258 : Disable automated cron on drush requests (#2259)
damiankloip 7039fef
Changed single quotes to double quotes in extra parameters (Sqlpgsql:…
kaszi a026d1c
'Sanitize query failed' with 'sqlsan --sanitize-password=no' on D8 (#…
steveoliver 16f24da
Unish will now use latest relese of Drupal 8, not tip of 8.0.x
weitzman eee64e3
Fix #2257 config-pull gets cancelled with no helpful error message.
weitzman 48d7179
Fix #2270. Don't show a warning for Requirements that are just INFO. …
weitzman 7b7490f
Oops - bad equals sign.
weitzman 282aa39
Fix make tests to not rely on sourceforge (#2269)
jhedstrom 2e99342
Fix #2219. twig-compile should find templates in all active themes.
weitzman 79e3288
Try to speed up builds by directory caching at Travis.
weitzman 853f6c4
Fixed method signature in DrupalKernel. (#2202)
mbovan ad8a0ff
Adds sub-options for xhprof_enable() flags. (#2174)
webbj74 b8fdb97
Fix #2277 pm-download puts drush commands in wrong location.
weitzman fec5794
Prep for 8.1.3.
weitzman 93b9a2d
Back to dev
weitzman 2ce823e
Fix #2287 and #1581. Warn about risks of using --no-backup option dur…
weitzman 32e505b
Fix #2110 and #2111 - Always return value from ->drop() method.
weitzman 9ffcecc
Fix SQL hostname for localhost #2017
AdamPS 8b658ea
Test project versions are checked strictly (no numeric equivalence).
jonhattan 71fde22
Use string comparison for release versions.
jonhattan 56e38bb
Fixed condition for hidden files.
Chi-teck 4989fbd
Fix drush_is_nested_directory() and drush_preflight_command_dispatch(…
weitzman c12fb28
Use DIRECTORY_SEPARATOR in startup.inc. (#2300)
weitzman 7fa503f
Get rid of Drush's own drush.bat.
weitzman 2ab1791
Fix #2302 - dont delete .htaccess during config-pull.
weitzman 4331d9b
Fix #2246. Can't make requests from same dir as drush.phar when renam…
weitzman 6bb741e
Fix #2246 by moving check for Phar discovery during startup.
weitzman 21a63cb
Fix #2210 Ignore .idea dir in git.
weitzman e021bd0
Fix #2288. Fix SQL hostname for grants in 8.x
weitzman b6d7308
fix typo in docs.
weitzman 7964327
download theme engines into the sensible default place for theme engi…
1e84e9a
Fix drush_backend_invoke_concurrent() thinks @self is a different site
tstoeckler 715a0e4
Skip the launcher when using Windows. (#2312)
weitzman 7258ec0
Double quotes around as it can contain spaces.
weitzman d5e16ea
Some enhancements to Finder and misc Unish fixes for Windows.
weitzman 47ea85e
Specify event-dispatcher in composer.json in order to get a Drupal co…
weitzman ba719da
Specify PHP 5.4 as platform requirement in composer.json. See https:/…
weitzman 303ca4b
Issue #2320: Fixing typo in includes/preflight.inc. (#2321)
serundeputy 4dad498
Fix #2318. Set cwd when Finder is launching via proc_open().
weitzman 92468a9
Add updb option to sync_enable example. (#2247)
thom8 c0ba05b
Handle requeue exception in 8.x (#2323)
juampynr 9b2bea7
Progress on Appveyor testing. Still lots of fails.
weitzman 5522726
A few test fixes for Windows.
weitzman 026d798
Add unish.bat for easier testing on Windows.
weitzman 1846e54
Merge pull request #2330 from drush-ops/fix-make-tests2
jhedstrom cdc8a6d
A few Windows related fixes.
weitzman d7d7f35
Fix escaping in testDispatchStrictOptions.
weitzman 89c1269
use stdin in test.
weitzman 37b469c
Break up testReleaseNotes for better Windows compat.
weitzman 7fda6c9
No fork test on Windows.
weitzman 10588e4
Appveyor tweak for testMakeBZ2.
weitzman c6fab52
Bit_bucket fix for Windows.
weitzman 8419577
A bit of work on testDrushFinder() for Windows compat.
weitzman 44c247e
Canonicalize paths for testCommandVersionSpecific().
weitzman 4e6847f
Windows test tweaks.
weitzman 489ee2a
Fix #1788. Remove winrs support.
weitzman 1c6e8d6
Parse error fix.
weitzman 8e5dcff
Skip complete test on Windows.
weitzman ec3738d
Fix expectation for drush-script.
weitzman 49079bf
Skip end of testDispatchStrictOptions() for Windows.
weitzman 4bb80dd
Simplify \Unish\drushScriptCase::getDrushLocation.
weitzman 651111e
Canonicalize the /path/to/drush.
weitzman 04de92f
standardize etc_drush path in test.
weitzman 3b3f96e
Canonicalize our expected path to drush.php in test.
weitzman e3eb801
Remove Unish\outputFormatCase::testOutputFormatWithDrupal as it is su…
weitzman 5274766
Uncomment 'Double up percents.' during Windows argument escaping in U…
weitzman 4c0869b
Undo double percents. Did not help.
weitzman 8bea1a3
Handle FALSE in drush_find_drush().
weitzman 4c4010e
Make a copy of the test fixture WootCommands, so that the Drupal 7 mo…
greg-1-anderson f978f5a
Try explicitly clearing the Drush commandfile cache.
greg-1-anderson 1c34905
The backslash at the beginning of the classname in @return statements…
greg-1-anderson 52796a9
Add a sanity-check assert to the woot commands test.
greg-1-anderson 42283d5
Updated composer.lock, and a few more asserts, to see the first direc…
greg-1-anderson cf64728
Add some error checking in the recursive_copy function.
greg-1-anderson f599ead
Only use recursive_copy in annotatedCommandTest on Windows.
greg-1-anderson 9695b7b
Update annotated command test for Drupal 6.
greg-1-anderson 42b11b5
Discover Drush's own annotated commands and convert browse to an anno…
weitzman 0a24401
Get latest consolidation/* packages
weitzman 7b7a490
Fix annotationcommand_adapter_process_command() for the case where th…
greg-1-anderson 834e517
Add support for @bootstrap and @handle-remote-commands annotations. N…
weitzman 11c49bc
Composer.lock changes. Keeps PHP 5.4 compat.
weitzman affee1b
Add argument completion for annotated commands.
weitzman 43e309d
Fix 2302 .htaccess getting removed during config-pull.
weitzman b28c7f0
Update URL to search for Drush packages on Packagist.
greg-1-anderson 03098c7
Prep for 8.1.4
weitzman 6c920f4
Back to dev.
weitzman f033ab5
drush.phar was trying to find launcher.
weitzman 1cf4b2d
Prep for 8.1.5
weitzman 41e3868
Back to dev.
weitzman befc2ca
Backport Composer support into make-convert command (#2368)
42ecc7e
Fix #2369. Update drush dependency phpdocumentor/reflection-docblock …
JTubex 411b8ad
Update to Annotated Commands 2.0.0-rc3.
greg-1-anderson 6ed4050
Update to new construction requirements for FormatterManager(), and g…
greg-1-anderson 42d7845
Update to annotated commands rc6, and add the example:table and drupl…
greg-1-anderson 59b5504
Display options added by hooks in help. Hooks are not called yet.
greg-1-anderson b496424
Validate options added by hooks, so an error is not returned if a use…
greg-1-anderson 9431f5f
Remove the old druplicon. Call the post-command hook from the annotat…
greg-1-anderson bcfbad7
Appropriately set default option values for options added by hooks.
greg-1-anderson b213e23
Update to latest annotated command hook APIs.
greg-1-anderson 43596f8
We need to put the command name back onto the head of the arguments i…
greg-1-anderson 53b03e2
Update to annotated-command 2.0.0-rc7 and output-formatters 2.0.0-rc3…
greg-1-anderson b515c19
Avoid the prompt when using --config-dir during site-install.
weitzman 02aabdf
Remove unnecessary (optional) $ from @option annotations.
greg-1-anderson fd5b1c7
Fill in the function bodies for the other hook functions.
greg-1-anderson 2a53dff
Update to stable releases of annotated-command and output-formatters.
greg-1-anderson dc0ac0e
Fix #2364. Source and target databases are the same while port number…
weitzman 52ec988
Fix typo.
weitzman 2db452b
Fix yaml makefile generation - reading looks for patch, not patches. …
NigelCunningham 6d75f28
Add some docblock comments to annotationcommand_adapter.inc.
greg-1-anderson 3ae42c0
Merge pull request #2366 from drush-ops/annotation-command-rc3
greg-1-anderson 96eea45
Merge 8.x branch into master -- use annotation adapter from 8.x to ma…
greg-1-anderson d23d9af
Remove duplicate 'browseCommands.php'; leave 'BrowseCommands.php'.
greg-1-anderson 9cc45c5
Fix construction of command objects.
greg-1-anderson 955a7a3
Add bootstrap annotation to eval command.
greg-1-anderson 428288c
Add @allow-additional-options annotation.
greg-1-anderson c0ddcc1
Adjust tests to match new behavior.
greg-1-anderson 9e49f1a
Remove unnecessary commented-out code from make.drush.inc.
greg-1-anderson 6eaaec2
Remove old init.drush.inc commandfile.
greg-1-anderson 2185d52
Remove includes/array_column.inc.
greg-1-anderson 686793f
Correct comments.
greg-1-anderson 161e826
Remove unneeded code.
greg-1-anderson bce299f
Clean up initialization / DI, and some minro command-related cleanup.
greg-1-anderson ef609ff
Make sure tests have @command annotation.
greg-1-anderson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Set up local Drush configuration. | ||
*/ | ||
|
||
use Drush\Log\LogLevel; | ||
|
||
/** | ||
* Implementation of hook_drush_command(). | ||
* | ||
* @return | ||
* An associative array describing your command(s). | ||
*/ | ||
function init_drush_command() { | ||
$items['core-init'] = array( | ||
'description' => 'Enrich the bash startup file with completion and aliases. Copy .drushrc file to ~/.drush', | ||
'aliases' => array('init'), | ||
'bootstrap' => DRUSH_BOOTSTRAP_NONE, | ||
'package' => 'core', | ||
'global-options' => array('editor', 'bg'), | ||
'options' => array( | ||
'edit' => 'Open the new config file in an editor.', | ||
'add-path' => "Always add Drush to the \$PATH in the user's .bashrc file, even if it is already in the \$PATH. Use --no-add-path to skip updating .bashrc with the Drush \$PATH. Default is to update .bashrc only if Drush is not already in the \$PATH.", | ||
), | ||
'examples' => array( | ||
'drush core-init --edit' => 'Enrich Bash and open drush config file in editor.', | ||
'drush core-init --edit --bg' => 'Return to shell prompt as soon as the editor window opens.', | ||
), | ||
); | ||
return $items; | ||
} | ||
|
||
/** | ||
* Initialize local Drush configuration | ||
*/ | ||
function drush_init_core_init() { | ||
$home = drush_server_home(); | ||
$drush_config_dir = $home . "/.drush"; | ||
$drush_config_file = $drush_config_dir . "/drushrc.php"; | ||
$drush_bashrc = $drush_config_dir . "/drush.bashrc"; | ||
$drush_prompt = $drush_config_dir . "/drush.prompt.sh"; | ||
$drush_complete = $drush_config_dir . "/drush.complete.sh"; | ||
$examples_dir = DRUSH_BASE_PATH . "/examples"; | ||
$example_configuration = $examples_dir . "/example.drushrc.php"; | ||
$example_bashrc = $examples_dir . "/example.bashrc"; | ||
$example_prompt = $examples_dir . "/example.prompt.sh"; | ||
$example_complete = DRUSH_BASE_PATH . "/drush.complete.sh"; | ||
$bashrc_additions = array(); | ||
|
||
// Create a ~/.drush directory if it does not yet exist | ||
if (!is_dir($drush_config_dir)) { | ||
drush_mkdir($drush_config_dir); | ||
} | ||
|
||
// If there is no ~/.drush/drushrc.php, then copy the | ||
// example Drush configuration file here | ||
if (!is_file($drush_config_file)) { | ||
copy($example_configuration, $drush_config_file); | ||
drush_log(dt("Copied example Drush configuration file to !path", array('!path' => $drush_config_file)), LogLevel::OK); | ||
} | ||
|
||
// If there is no ~/.drush/drush.bashrc file, then copy | ||
// the example bashrc file there | ||
if (!is_file($drush_bashrc)) { | ||
copy($example_bashrc, $drush_bashrc); | ||
$pattern = basename($drush_bashrc); | ||
$bashrc_additions["%$pattern%"] = "# Include Drush bash customizations.\n". drush_bash_addition($drush_bashrc); | ||
drush_log(dt("Copied example Drush bash configuration file to !path", array('!path' => $drush_bashrc)), LogLevel::OK); | ||
} | ||
|
||
// If there is no ~/.drush/drush.complete.sh file, then copy it there | ||
if (!is_file($drush_complete)) { | ||
copy($example_complete, $drush_complete); | ||
$pattern = basename($drush_complete); | ||
$bashrc_additions["%$pattern%"] = "# Include Drush completion.\n". drush_bash_addition($drush_complete); | ||
drush_log(dt("Copied Drush completion file to !path", array('!path' => $drush_complete)), LogLevel::OK); | ||
} | ||
|
||
// If there is no ~/.drush/drush.prompt.sh file, then copy | ||
// the example prompt.sh file here | ||
if (!is_file($drush_prompt)) { | ||
copy($example_prompt, $drush_prompt); | ||
$pattern = basename($drush_prompt); | ||
$bashrc_additions["%$pattern%"] = "# Include Drush prompt customizations.\n". drush_bash_addition($drush_prompt); | ||
drush_log(dt("Copied example Drush prompt file to !path", array('!path' => $drush_prompt)), LogLevel::OK); | ||
} | ||
|
||
// Decide whether we want to add our Bash commands to | ||
// ~/.bashrc or ~/.bash_profile | ||
$bashrc = drush_init_find_bashrc($home); | ||
|
||
// If Drush is not in the $PATH, then figure out which | ||
// path to add so that Drush can be found globally. | ||
$add_path = drush_get_option('add-path', NULL); | ||
if ((!drush_which("drush") || $add_path) && ($add_path !== FALSE)) { | ||
$drush_path = drush_find_path_to_drush($home); | ||
$drush_path = preg_replace("%^" . preg_quote($home) . "/%", '$HOME/', $drush_path); | ||
|
||
$bashrc_additions["%$drush_path%"] = "# Path to Drush, added by 'drush init'.\nexport PATH=\"\$PATH:$drush_path\"\n\n"; | ||
} | ||
|
||
// Modify the user's bashrc file, adding our customizations. | ||
$bashrc_contents = ""; | ||
if (file_exists($bashrc)) { | ||
$bashrc_contents = file_get_contents($bashrc); | ||
} | ||
$new_bashrc_contents = $bashrc_contents; | ||
foreach ($bashrc_additions as $pattern => $addition) { | ||
// Only put in the addition if the pattern does not already | ||
// exist in the bashrc file. | ||
if (!preg_match($pattern, $new_bashrc_contents)) { | ||
$new_bashrc_contents = $new_bashrc_contents . $addition; | ||
} | ||
} | ||
if ($new_bashrc_contents != $bashrc_contents) { | ||
if (drush_confirm(dt(implode('', $bashrc_additions) . "Append the above code to !file?", array('!file' => $bashrc)))) { | ||
file_put_contents($bashrc, "\n\n". $new_bashrc_contents); | ||
drush_log(dt("Updated bash configuration file !path", array('!path' => $bashrc)), LogLevel::OK); | ||
drush_log(dt("Start a new shell in order to experience the improvements (e.g. `bash`)."), LogLevel::OK); | ||
if (drush_get_option('edit')) { | ||
$exec = drush_get_editor(); | ||
drush_shell_exec_interactive($exec, $drush_config_file, $drush_config_file); | ||
} | ||
} | ||
else { | ||
return drush_user_abort(); | ||
} | ||
} | ||
else { | ||
drush_log(dt('No code added to !path', array('!path' => $bashrc)), LogLevel::OK); | ||
} | ||
} | ||
|
||
/** | ||
* Determine which .bashrc file is best to use on this platform. | ||
*/ | ||
function drush_init_find_bashrc($home) { | ||
return $home . "/.bashrc"; | ||
} | ||
|
||
/** | ||
* Determine where Drush is located, so that we can add | ||
* that location to the $PATH | ||
*/ | ||
function drush_find_path_to_drush($home) { | ||
// First test: is Drush inside a vendor directory? | ||
// Does vendor/bin exist? If so, use that. We do | ||
// not have a good way to locate the 'bin' directory | ||
// if it has been relocated in the composer.json config | ||
// section. | ||
if ($vendor_pos = strpos(DRUSH_BASE_PATH, "/vendor/")) { | ||
$vendor_dir = substr(DRUSH_BASE_PATH, 0, $vendor_pos + 7); | ||
$vendor_bin = $vendor_dir . '/bin'; | ||
if (is_dir($vendor_bin)) { | ||
return $vendor_bin; | ||
} | ||
} | ||
|
||
// Fallback is to use the directory that Drush is in. | ||
return DRUSH_BASE_PATH; | ||
} | ||
|
||
function drush_bash_addition($file) { | ||
return <<<EOD | ||
if [ -f "$file" ] ; then | ||
source $file | ||
fi | ||
|
||
|
||
EOD; | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,7 +155,12 @@ function make_drush_command() { | |
'makefile' => 'Filename of the makefile to convert.', | ||
), | ||
'options' => array( | ||
'format' => 'The format to which the make file should be converted. Accepted values include make, composer, and yml.' | ||
'format' => 'The format to which the make file should be converted. Accepted values include make, composer, and yml.', | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debug code? Why commented out? |
||
'projects' => $projects, | ||
'libraries' => $libraries, | ||
'includes' => 'A list of makefiles to include at build-time.', | ||
*/ | ||
), | ||
'required-arguments' => TRUE, | ||
'examples' => array( | ||
|
This file contains 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have https://github.com/drush-ops/drush/blob/master/lib/Drush/CommandFiles/InitCommandFile.php. We should not add this old style file back in, I think.