Added atom plugin for cygwin

This commit is contained in:
Ramses Ladlani 2015-10-06 16:17:55 +02:00
parent 9c08641d7c
commit 9e68758f4a
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,17 @@
## atom-cygwin
This plugin allows invoking the Atom Editor from Cygwin using the `atom` command.
For this purpose, it uses `cygpath` to convert between Unix and Windows paths.
### Requirements
* [Atom](https://atom.io/)
* [Cygwin](https://www.cygwin.com/)
### Usage
Same as the original CLI script (pointed by `${LOCALAPPDATA}/atom/bin/atom`).
* If `atom` command is called without an argument, launch Atom
* If `atom` is passed a directory, open it in Atom
* If `atom` is passed a file, open it in Atom

View File

@ -0,0 +1,18 @@
if [[ "$OSTYPE" == "cygwin" ]]; then
local _atom_path > /dev/null 2>&1
_atom_path=${LOCALAPPDATA}/atom/bin/atom
if [[ -a $_atom_path ]]; then
cyg_open_atom()
{
if [[ -n $1 ]]; then
${_atom_path} `cygpath -w -a $1`
else
${_atom_path}
fi
}
alias atom=cyg_open_atom
fi
fi