Skip to content

Instantly share code, notes, and snippets.

@g3r4
Forked from jmolivas/how-to-setup.md
Created April 28, 2017 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g3r4/67016595185ab98a4c4b50e99deff624 to your computer and use it in GitHub Desktop.
Save g3r4/67016595185ab98a4c4b50e99deff624 to your computer and use it in GitHub Desktop.

Contribution setup instructions

Fork DrupalConsole

Fork your own copy of the DrupalConsole repository to your account

Clone

Get a copy of your recently cloned version of console in your machine.

$ git clone git@github.com:[your-git-user-here]/drupal-console.git

If you have the project cloned already Make sure you sync with upstream for the latest changes.

Configuring a remote fork:

Specify and configure a new remote upstream repository that points to the upstream repository in Git.

git remote add upstream https://github.com/hechoendrupal/drupal-console.git

Syncing your fork

Sync your fork to keep it up-to-date with the upstream repository.

git fetch upstream
git merge upstream/master

Install dependencies

Now that you have cloned/updated the project, you need to download/update dependencies via Composer.

$ cd /path/to/DrupalConsole
$ composer install

Install Drupal using DrupalComposer project

composer create-project \
drupal-composer/drupal-project:8.x-dev \
drupal.dev \
--prefer-dist \
--no-progress \
--no-interaction

Where drupal.dev is the directory name where Drupal 8 will be installed.

Confirm DrupalConsole downloaded version.

Execute composer show | grep drupal/console from new drupal.dev created directory you should see an output like this one.

drupal/console                     
drupal/console-core                
drupal/console-en 

Update composer.json adding local repository.

    "repositories": [
        ...
        {
            "type": "path",
            "url": "/PATH/TO/DRUPAL-CONSOLE"
        }
    ],

Where /PATH/TO/DRUPAL-CONSOLE is the path where DrupalConsole was previously cloned.

Update composer.json Drupal Console package to read from local cloned repo.

"require": {
        ...
        "drupal/console": "*",
        ...
},

Remove DrupalConsole vendor directory

rm -rf vendor/drupal/console

Update DrupalConsole using composer

composer update drupal/console --with-dependencies

Confirm DrupalConsole was updated

Execute composer show | grep drupal/console you should see an output like this one.

drupal/console                     
drupal/console-core                
drupal/console-en                  

Copy autoload file

Change directory where DrupalConsole was forked. Copy the autoload.local.php.dist file as autoload.local.php

cp autoload.local.php.dist autoload.local.php

Confirm DrupalConsole is properly working

vendor/bin/drupal list

Install DrupalConsole launcher tool

curl https://drupalconsole.com/installer -L -o drupal.phar
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal

NOTE: If you have the global executable already in your system, use self-update command to download the latest version.

Confirm executable is working properly

Move to drupal.dev directory and execute drupal list.

Available commands:
  about           Display basic information about Drupal Console project
  check           System requirement checker
  complete        Shell completion command list
  exec            Execute an external command.
  help            Displays help for a command
  init            Copy configuration files to user home directory.
  list            Lists all available commands
 settings
  settings:debug  List user Drupal Console settings.
  settings:set    Change a specific setting value in DrupalConsole config file


 [WARNING] In order to list all of the available commands you should install drupal first.

Install Drupal

Execute drupal site:install and answer question using the interactive mode.

Execute the server command, open your browser and point it to http://127.0.0.1:8088.

Write you code changes

You can now make changes on your DrupalConsole local branch and should be reflected on your site immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment