guarinogabriel / Mac-CLI

 macOS command line tool for developers – The ultimate tool to manage your Mac. It provides a huge set of command line commands that automatize the usage of your Mac.
MIT License
8.88k stars 334 forks source link

Can't change preferred editor #126

Closed revolter closed 4 years ago

revolter commented 7 years ago

Following the README's configuration instructions, I opened the mac file to change my preferred editor, but that line is:

export pref_editor="${pref_Editor}"

Where is the pref_Editor defined?

karawitan commented 4 years ago

pref_editor is prompted when script mac-cli/tools/install is called, and then, it's stored inside 'mac' script

Here is the relevant code from mac-cli/tools/install:

    echo "${LIGHTGREEN}Please enter your favourite text editor (by entering the command that opens your favourite editor. i.e: nano):"
    echo "${NC}Press enter without any value to keep default: vi"
    read pref_editor
    if [ ! -z "$pref_editor" -a "$pref_editor" != " " ]; then
        LC_CTYPE=C sed -i'' -e 's#pref_editor="vi"#pref_editor="${pref_Editor}"#g' "$PACKAGE_DIRECTORY/mac-cli/mac"
    fi
revolter commented 4 years ago

Understood, thank you!