bork icon indicating copy to clipboard operation
bork copied to clipboard

Filesection type

Open ricochet1k opened this issue 6 years ago • 2 comments

This lets you do

ok filesection target source --start='#start' --end='#end' --ifmissing=append

which will look for a section like

#start
stuff here
#end

and replace everything in between with the source file.

It also contains a few minor fixes to bake and test helpers that fix passing spaces and other magic characters. It's not a full solution like #126 might be, but it makes these few things work.

ricochet1k avatar Jun 22 '18 02:06 ricochet1k

What are some general use cases for this?

It's fairly easy to have your own custom type definitions alongside your config, see: https://github.com/mattly/dotfiles/blob/89a9831a07ba42a20d2cb765ec1df78dada43829/bork/_mac_dev_basics.sh#L30 and https://github.com/mattly/dotfiles/blob/89a9831a07ba42a20d2cb765ec1df78dada43829/bork/types/npm-config.sh

mattly avatar Jun 25 '18 04:06 mattly

I want to use bork to manage my dotfiles, and I'd like to use this filesection type to maintain a default setup for most of the dotfiles while allowing local overrides/extras. So I'll have a ./bin directory in my dotfiles, and I'll use filesection to update the PATH variable in the .profile or .bash_profile directory.

I think it's great that I can include my own types. I just put a lot of work into this to make it general and useful and I thought others might want to use it too, just like how I really want that npm-config type. And a git-config type. Why is that not in the main bork repo?

ricochet1k avatar Jun 29 '18 17:06 ricochet1k