Skip to content

Instantly share code, notes, and snippets.

@jmosbech
Last active September 11, 2017 22:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jmosbech/9364440 to your computer and use it in GitHub Desktop.
Save jmosbech/9364440 to your computer and use it in GitHub Desktop.
Windows command line shortcut to WebStorm. Clone, add to path, celebrate!
#!/bin/sh
# find newest webstorm install
WS=`find /C/Program\ Files\ \(x86\)/JetBrains/*/bin/webstorm.exe -type f -printf '%T@ %p\n' | sort -r | sed 's/^[^ ]* //' | head -n 1`
# open current dir
DIR=`pwd`
`"$WS" "$DIR"` &
@mac2000
Copy link

mac2000 commented Apr 25, 2017

JFYI: if you are not on Toolbox, you may find path to executable like so:

@ECHO OFF

REM Remove registry if any
REG DELETE "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /f

REM Get WebStorm executable path
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_CLASSES_ROOT\Applications\WebStorm.exe\shell\open\command"`) DO (
	SET WEBSTORM=%%A %%B
)

REM Remove ' "%1"' from it
SET WEBSTORM=%WEBSTORM:~0,-5%

REM Add registry keys
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_SZ /v "" /d "Open directory in WebStorm" /f
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WEBSTORM%,0" /f
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\WebStorm\command" /t REG_SZ /v "" /d "%WEBSTORM% \"%%1\"" /f

PAUSE

just replace reg stuff to path and you are ready to go, idea behind is that it will work on clean setup and does not require bash installed

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