atom.plugin.zsh 713 Bytes
Newer Older
1
2
3
4
if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
    local _atom_path > /dev/null 2>&1

    _atom_path=${LOCALAPPDATA}/atom/bin/atom
Arno Fortelny's avatar
Arno Fortelny committed
5
6

    if [[ -a $_atom_path ]]; then
7
8
9
10
11
12
13
14
15
16
        cyg_open_atom()
        {
            if [[ -n $1 ]]; then
                ${_atom_path} `cygpath -w $1`
            else
                ${_atom_path}
            fi
        }

        alias at=cyg_open_atom
Arno Fortelny's avatar
Arno Fortelny committed
17
    fi
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
else
    local _atom_paths > /dev/null 2>&1

    _atom_paths=(
        "$HOME/Applications/Atom.app"
        "/Applications/Atom.app"
    )

    for _atom_path in $_atom_paths; do
        if [[ -a $_atom_path ]]; then
            alias at="open -a '$_atom_path'"
            break
        fi
    done
fi
Arno Fortelny's avatar
Arno Fortelny committed
33
34

alias att='at .'