Skip to content

Instantly share code, notes, and snippets.

@xymox12
Last active August 29, 2015 14:09
Show Gist options
  • Save xymox12/75aa531866511e37955f to your computer and use it in GitHub Desktop.
Save xymox12/75aa531866511e37955f to your computer and use it in GitHub Desktop.
ConEmu Setup for Composer, Drush, Etc

Git

Note: Download the portable version

To make this truely portable take a gander at:

Setup the GIT environment:

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ git config --global core.autocrlf input

Add GIT to the Windows PATH

In this case I simply added 'C:\bin\Git\cmd' to the user environment variable PATH. I tend to make my life easier by using a path editor such as http://patheditor2.codeplex.com/

Composer

Note: Place this in a folder called 'composer' within the bin directory

OR

Use the composer_install.bat file below to install composer

ConEmu

Integrate Git and ConEmu

Drush, WP-CLI, Mess Detector and Code Sniffer

All of these are installed using composer

@echo off
:: Alternative to using ConEmu Task to set up composer
SET USdir=%~dp0
SET PHPdir=%USdir%php54
SET MYSQLdir=%USdir%mysql5540\bin
SET GNUWINdir=%USdir%GnuWin32\bin
ECHO %PATH% | find /C /I "%PHPdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%PHPdir%"
)
ECHO %PATH% | find /C /I "%MYSQLdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%MYSQLdir%"
)
ECHO %PATH% | find /C /I "%GNUWINdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%GNUWINdir%"
)
@php %USdir%composer\composer.phar %*
{
"require": {
"drush/drush": "6.*",
"phpmd/phpmd" : "1.4.*",
"squizlabs/php_codesniffer": "1.*",
"wp-cli/wp-cli": "dev-master"
}
}
@echo off
SET USdir=%~dp0
SET PHPdir=%USdir%php54
SET MYSQLdir=%USdir%mysql5540\bin
SET GNUWINdir=%USdir%GnuWin32\bin
SET DRUSHdir=%USdir%vendor\drush\drush
ECHO %PATH% | find /C /I "%PHPdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%PHPdir%"
)
ECHO %PATH% | find /C /I "%MYSQLdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%MYSQLdir%"
)
ECHO %PATH% | find /C /I "%GNUWINdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%GNUWINdir%"
)
@php.exe "%DRUSHdir%\drush.php" %*
PROMPT=$E[92m$P$E[90m$G$E[m$S & SET PATH=%PATH%;%ConEmuDir%\php54;%ConEmuDir%\mysql5540\bin;%ConEmuDir%\GnuWin32\bin & cmd /k doskey composer=php %ConEmuDir%\composer\composer.phar $* & cmd -cur_console:t:"Composer"
bin\
    ConEmu64.exe
    ConEmu\
          Addons ... etc
    plugins\
          ConEmu\
    composer\
          composer.phar
    GnuWin32\
    mysql5540\
    php54\
    vendor\
          
@echo off
SET USdir=%~dp0
SET GNUWINdir=%USdir%GnuWin32\bin
ECHO %PATH% | find /C /I "%GNUWINdir%" 1>nul
if errorlevel 1 (
SET "PATH=%PATH%;%GNUWINdir%"
)
@SET USdir=%~dp0
@SET PHPdir=%USdir%php54
@SET "PATH=%PATH%;%PHPdir%;%USdir%GnuWin32\bin;%USdir%mysql5540\bin"
echo Downloading Composer.phar
@mkdir composer
@wget -P .\composer http://getcomposer.org/composer.phar
echo Creating composer bat file
@echo @SET bindir=%%~dp0>composer.bat
@echo @SET PATH=%%PATH%%;%%bindir%%php54>>composer.bat
@echo @php %%~dp0composer\composer.phar %%*>>composer.bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment