Set up the filters required to ignore local dev config.

This commit is contained in:
Robert Marshall 2020-04-04 13:16:50 +01:00
parent a375a4356a
commit 03fb0b58fd
5 changed files with 16 additions and 1 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
/Website/appsettings.Development.json filter=clean-config

2
.gitconfig Normal file
View file

@ -0,0 +1,2 @@
[filter "clean-config"]
clean = ./clean-config.sh

View file

@ -4,6 +4,9 @@ Old repo: https://git.robware.uk/rob/Robware
My old repo was my attempt at an MVC framework. While I learned a lot about how to make an MVC framework, it was quite a pain to keep up. Now I'm using .NET Core ASP MVC. I much prefer C# and the whole thing is much nicer to work with.
## Setup
After clone, please run `git config --local include.path ../.gitconfig`. This will set up the filters required to ignore local dev config.
## Changes on previous implementation:
* Not PHP
* Use markdown for blog posts instead of own rolled markup solution

View file

@ -8,5 +8,7 @@
},
"ConnectionStrings": {
"database": "Server=localhost;User ID=user;Password=pass;Database=db"
}
},
"gitDomain": "",
"gitToken": ""
}

7
clean-config.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
sed \
-e 's/"database": "Server=.*;User ID=.*;Password=.*;Database=.*"/"database": "Server=localhost;User ID=user;Password=pass;Database=db"/g' \
-e 's/"gitDomain": ".*"/"gitDomain": ""/g' \
-e 's/"gitToken": ".*"/"gitToken": ""/g' \
$1