boundedinfinity / userdotd

1 stars 0 forks source link

init shell detection #13

Open boundedinfinity opened 5 years ago

boundedinfinity commented 5 years ago

The initialization should detect the shells that are installed before attempting to initialize the structure for that shell. For example if the system doesn't have the fish shell installed, then it shouldn't attempt to initialized the fish shell directories.

berryhill commented 5 years ago

@boundedinfinity May be a good first issue for me.. find

boundedinfinity commented 5 years ago

Using find is a possibility, however this should probably only use shells that are in the $PATH. So using the normal which or type commands may be a better fit here, or maybe there is some built-in go library that already does this.

berryhill commented 5 years ago

@boundedinfinity ok sounds good, I'll throw something basic together that works, and then maybe we can discuss refactor in a manner that identifies a design pattern you may have in mind. IE: what package, what files... ect.

berryhill commented 5 years ago

@boundedinfinity I was able to build the docker image, however, I had to un.gitignore the ./system/ab0x.go file so the CLI could import the ReadFile() function.. I feel like that's something that's not intended so maybe some insight on why we're ignoring that file in the first place would be helpful.

Pushed on a separate branch for now and can be found here

berryhill commented 5 years ago

The following lines of code will need to be refactored:

https://github.com/boundedinfinity/userdotd/blob/630eab759e6ac649a13dd62bfc7e5b6c443263e5/docker/base/Dockerfile#L19

https://github.com/boundedinfinity/userdotd/blob/630eab759e6ac649a13dd62bfc7e5b6c443263e5/docker/fish/Dockerfile#L19

boundedinfinity commented 5 years ago

@berryhill k, do what you need to do to test things, and we can fix it later, for this issue, if i understand things correctly (not having looked through the code yet), you'll need to run the go generate command inside the container, which generates that file (which is the reason that it is in the .gitignore file).

The docker file should also probably just run the make build target.

I haven't looked through your whole structure yet, but I think that should do the trick. and if you cant run the stuff from the make file for now, just run go generate, then go build or go install.