Skip to content
This repository has been archived by the owner on Feb 14, 2021. It is now read-only.

Filesection type #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Filesection type #137

wants to merge 1 commit into from

Conversation

ricochet1k
Copy link
Contributor

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.

@mattly
Copy link
Owner

mattly commented Jun 25, 2018

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

@ricochet1k
Copy link
Contributor Author

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants