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.86k stars 333 forks source link

Enhancement : Home Brew installation method / package #112

Closed beejhuff closed 2 years ago

beejhuff commented 7 years ago

@guarinogabriel , it was great seeing your talk and chatting at the Austin Mage Titans event! I found this repository and immediately wondered why there wasn't a brew installation package...

Before I start hacking away at this I wanted to see if you had considered this already and run into any blockers?

guarinogabriel commented 7 years ago

Hi @beejhuff

Thanks for your interest to contribute with the project. There was a discussion about integrating Homebrew: https://github.com/guarinogabriel/Mac-CLI/issues/28

The only problem is that the "installation wizard" should be removed in order to make a brew package.

Do you think there is a way to implement Homebrew and implement the wizard?

beejhuff commented 7 years ago

There are definitely a few options as I've used homebrew to install packages that included wizard functionality. In general, Inseemmtj recall the general approach is to refactor the installation so that is has two components: installation which does the bare minimum installation of required files and file system permission configuration and the configurator which either runs the wizard or if it detects a config option file just uses those values to silently run the wizard as a background process.

I haven't dug too deep "LU but my guess is that you probably have some type of similarl logical structure at some level already, but I'll don deeper review when I'm done driving to visit family in a day or two.

For non-brew installations you'd just execute each component automatically in sequence so the user never had to worry about the change.

guarinogabriel commented 7 years ago

@beejhuff – I really like the idea of running brew install mac-cli and automate the process by using Homebrew as package manager.

You mention that you used homebrew to install packages that included wizard. Do you remember the name of those packages to investigate further?

beejhuff commented 7 years ago

I want to say that OpenShift from RedHat was one...I'm digging to through my local repos to confirm...

sbibauw commented 7 years ago

@guarinogabriel I totally second installing through brew. Regarding the installation wizard, you might actually need it less than you think. I think all the "Do you want to install plugin X?" decisions could be left out, considering the extremely small size (a couple of Ko) of each plugin, and the fact that all the commands are there anyway (in help/list section, in bash completions...) (e.g., I didn't install glances, but now I get an error on mac system...). Just install every CLI function.

I would recommend avoiding using Mac-CLI to install other programs you can install with Homebrew (composer, pv, git, node, python, sass, fdupes...). Just set dependencies for things you absolutely need (node to install fast-cli? wget? - I suppose you can rely on base macOS installation of Python and pip, etc.) and let people choose the others they need (it is easy enough with brew install - you can still recommend to install those in the "Caveat" message). Focus on offering CLI functions for mac. Let programs such as strap bootstrap a new Mac environment for development.

Regarding the "Where is app/file X?" questions, you might be able to automatically get some of the answers (e.g., which mysql, which php, ). For the Dropbox folder question, beyond the fact that it is extremely often ~/Dropbox, you can actually find that info in ~/.dropbox/info.json under personal.path. For MySQL, you can get some variables from mysqladmin variables (socket, etc.). Anyway, you currently ask for a few paths and configs (MySQL, PHP, etc.), but still assume others (e.g., you assume that MAMP is installed... even for php:info. I had to manually edit the config file to set mac mamp:start to launch apachectl -k start and mysql.server start). (It also installs composer when I had it already installed from Homebrew).

If you need more variables you can't obtain automatically, you may set a "Caveat" message indicating to fill in a config file with those variables (as well as config options such as echocommand with a default value).

marnovo commented 6 years ago

@sbibauw's suggestions seem very sensible!

Is this still in the roadmap? Do you plan to implement this yourself or do you need help on it? Thanks for the work.

guarinogabriel commented 6 years ago

Hi @marnovo,

It is definitely on the roadmap, but unfortunately I am not available at the moment.

Any help is definitely appreciated, thanks!

Gabriel

guarinogabriel commented 2 years ago

Hi everyone,

Since this is a very old Github Issue, I am proceeding by closing it but feel free to create Pull Requests for the improvements you would like to make on the project.