leokhoa / laragon

Laragon is a portable, isolated, fast & powerful universal development environment for PHP, Node.js, Python, Java, Go, Ruby. It is fast, lightweight, easy-to-use and easy-to-extend.
https://laragon.org
4.47k stars 372 forks source link

Cmder aliases not working #126

Open eleazan opened 5 years ago

eleazan commented 5 years ago

On Cmder v1.3.2 the "alias" are broken on windows. That's an issue on Cmder, and you can fix setting "legacy" to the cmd.exe... but you loose WSL.

For avoid that, you can attach the last Cmder version that has the fix inside

daxgames commented 4 years ago

Replace c:\laragon\bin\cmder\vendor\clink folder with the one from the current Cmder release package.

daxgames commented 4 years ago

The below is a repost from the Laragon forum:

Also a better way to integrate Cmder into Laragon:

  1. Never edit %cmder_root%\vendor\init.bat or ANYTHING in %cmder_root%\vendor! Never Ever! Hopefully that's clear. :-)
  2. Copy lines 168-215 of Laragon's %cmder_root%\vendor\init.bat.
  3. Create a new file in %cmder_root%\config\profile.d\laragon.cmd.
  4. Start the file with the below content:

    @echo off
    
    echo %CMDER_ROOT% | findstr /i "\laragon\bin\cmder"
    if "%ERRORLEVEL%" equ "0" call :laragon
    exit /b 0
    
    :laragon
  5. Add the copied content from Laragon's %cmder_root%\vendor\init.bat to %cmder_root%\config\profile.d\laragon.cmd
  6. End %cmder_root%\config\profile.d\laragon.cmd with:

    exitt /b 0

This makes the Cmder install in Laragon Cmder upgrade friendly using Updating Cmder

daxgames commented 4 years ago

See #199

korykim commented 3 years ago

以下是Laragon论坛的转发:

将Cmder集成到Laragon中的一种更好的方法是:

  1. 切勿%cmder_root%\vendor\init.bat在%cmder_root%\ vendor中进行编辑或任何操作!永远不能!希望这很清楚。:-)
  2. 复制Laragon的行168-215 %cmder_root%\vendor\init.bat
  3. 在中创建一个新文件%cmder_root%\config\profile.d\laragon.cmd
  4. 使用以下内容启动文件:

    @echo off
    
    echo %CMDER_ROOT% | findstr /i "\laragon\bin\cmder"
    if "%ERRORLEVEL%" equ "0" call :laragon
    exit /b 0
    
    :laragon
  5. 将Laragon复制的内容添加%cmder_root%\vendor\init.bat%cmder_root%\config\profile.d\laragon.cmd
  6. 结尾%cmder_root%\config\profile.d\laragon.cmd为:
    exitt /b 0

这使得使用更新Cmder在Laragon Cmder中安装Cmder可以轻松升级

my example

echo %CMDER_ROOT% | findstr /i "\laragon\bin\cmder" if "%ERRORLEVEL%" equ "0" call :laragon exit /b 0

:laragon

:: Laragon Start -------------------------------------------------------------------

if exist "%CMDER_ROOT%..\git" ( set "GIT_INSTALL_ROOT=%CMDER_ROOT%..\git" )

if exist "%GIT_INSTALL_ROOT%\post-install.bat" ( echo Running Git for Windows one time Post Install.... pushd "%GIT_INSTALL_ROOT%" call "%GIT_INSTALL_ROOT%\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat @DEL post-install.bat

popd
:: cd /d %USERPROFILE%
rem

)

for /f "delims=" %%i in ("%CMDER_ROOT%....\usr") do set USER_DIR=%%~fi set USR_DIR=%USER_DIR%

if exist "%CMDER_ROOT%..\laragon\laragon.cmd" ( :: call Laragon own commands call "%CMDER_ROOT%..\laragon\laragon.cmd" )

if exist "%USER_DIR%\user.cmd" ( rem create this file and place your own command in there call "%USER_DIR%\user.cmd" ) else ( echo Creating user startup file: "%USER_DIR%\user.cmd" ( echo :: use this file to run your own startup commands echo :: use in front of the command to prevent printing the command echo. echo :: call start-ssh-agent.cmd echo :: set PATH=%%USER_DIR%%\bin\whatever;%%PATH%% echo. echo :: cmd /c start http://localhost echo. ) > "%USER_DIR%\user.cmd"

:: cd /d "%CMDER_ROOT%\..\..\www"
rem

)

:: Laragon End -------------------------------------------------------------------

exit /b 0

- Add Cmder alias => edit file `X:\laragon\bin\cmder\config\user_aliases.cmd`
- Add content

cr=composer cri=composer install crd=composer dump-autoload $* cru=composer update"

pa=php artisan $ pamm=php artisan make:model $ pamc=php artisan make:controller $Controller pakg=php artisan key:generate $ pamt=php artisan make:test $ pamf=php artisan migrate:fresh $ pami=php artisan migrate $ pads=php artisan db:seed $ pas=php artisan serve $* tinker=php artisan tinker

ndev=npm run dev nprod=npm run prod nhot=npm run hot


- Restart Cmder
- pamc Post =>`Controller created successfully.`
- Finish work!