Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main file option #97

Closed
rcmdnk opened this issue Nov 24, 2020 · 2 comments
Closed

Add main file option #97

rcmdnk opened this issue Nov 24, 2020 · 2 comments

Comments

@rcmdnk
Copy link
Owner

rcmdnk commented Nov 24, 2020

Currently, any new packages found in brew file init are added in the root Brewfile.

It is useful if it has an option that
brew file init adds packages to the branch Brewfile, which is specified by file command in the root Brwefile.

For example, let consider
that you want to share the same Brewfile at several machines,
but some packages are needed for the specific machine.

In this case, with the current brew-file,
you can make the following Brewfile:

...
file Brewfile.$HOSTNAME

and prepare Brewfile.machine1, with the content like:

brew package_only_for_machine1

Then you can install packages by brew file install in all machines,
and package_only_for_machine1 is installed only in the machine1.

But you need to add or modify Brewfile and Brewfile.machine1 manually when you add new packages.
Otherwise, if you execute brew file init, these packages will be added in the root Brewfile.

Therefore, it is good to have another command of file, like main_file.
If you have the root Brewfile like:

...
main_file Brewfile.$HOSTNAME

then brew file init will add new packages in Brwefile.$HOSTNAME if it is exists otherwise in the root Brewfile.

Maybe it is better to have an option to select the root or the main Brewfile for brew file init (and wrapped brew install command).

@rcmdnk
Copy link
Owner Author

rcmdnk commented Aug 4, 2021

--
brewinfo
brewinfo_ext

->
brewinfo_main
brewinfo_ext

DONE

--

move brewinfo to ext
remove main brewinfo from brewinfo_ext

DONE

--

At initialize, put read list to main brewinfo's list
cleanup: remove non-existing packages from all brewinfos, remove packages from main list if they are in other ext brewinfo. remain all tap list in main brewinfo in any case

DONE

--
Make main file if it does not exist

->
If any packages are included in the file, the file is created.
About main, it has at least some taps, then it is created in any case

@rcmdnk
Copy link
Owner Author

rcmdnk commented Aug 4, 2021

Added:
f3db6da
bd33c26
8511cd8

@rcmdnk rcmdnk closed this as completed Aug 4, 2021
@rcmdnk rcmdnk reopened this Aug 4, 2021
@rcmdnk rcmdnk closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant