From 9e68758f4a87be9e902751c7d52036c4af98d999 Mon Sep 17 00:00:00 2001 From: Ramses Ladlani Date: Tue, 6 Oct 2015 16:17:55 +0200 Subject: [PATCH] Added atom plugin for cygwin --- plugins/atom-cygwin/README.md | 17 +++++++++++++++++ plugins/atom-cygwin/atom-cygwin.plugin.zsh | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 plugins/atom-cygwin/README.md create mode 100644 plugins/atom-cygwin/atom-cygwin.plugin.zsh diff --git a/plugins/atom-cygwin/README.md b/plugins/atom-cygwin/README.md new file mode 100644 index 00000000..919bc9e8 --- /dev/null +++ b/plugins/atom-cygwin/README.md @@ -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 diff --git a/plugins/atom-cygwin/atom-cygwin.plugin.zsh b/plugins/atom-cygwin/atom-cygwin.plugin.zsh new file mode 100644 index 00000000..a622294e --- /dev/null +++ b/plugins/atom-cygwin/atom-cygwin.plugin.zsh @@ -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