https://github.com/devlooped/catbag
A repository of loose helpers, base clases and assorted code
https://github.com/devlooped/catbag
Last synced: about 1 year ago
JSON representation
A repository of loose helpers, base clases and assorted code
- Host: GitHub
- URL: https://github.com/devlooped/catbag
- Owner: devlooped
- License: mit
- Created: 2021-05-05T16:00:59.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T00:03:04.000Z (over 1 year ago)
- Last Synced: 2025-03-25T03:34:13.723Z (over 1 year ago)
- Language: C#
- Size: 128 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# :cat:bag
A repository of loose helpers, base clases and assorted code that can be trivially referenced
individually or by folders, using [dotnet-file](https://github.com/devlooped/dotnet-file).
> **cat**:
> 1. [cat](http://www.linfo.org/cat.html) is one of the most frequently used commands on Unix-like operating systems.
> It has three related functions with regards to text files: displaying them, combining copies of them and creating new ones.
> 2. (bag): in spanish, "bolsa de gatos". In Argentina, roughly a "mixed bag" of code, especially
> when referring to projects like "Helpers" and "Common" which everyone hates but can't quite avoid.
You can efectively "cat" files from this repo straight into yours.
Each piece of functionality that extends the dotnet framework (or any library, actually) in this manner,
is hereafter known as a 🐱 (`:cat:`).
For example, running the following on your repository root:
```
> dotnet file add https://github.com/devlooped/catbag/blob/main/System/Xml/XmlWrappingReader.cs src/Common/
```
Will download and add the file to `src/Common/System/Xml/XmlWrappingReader.cs` (you `cat` the remote file).
If no target directory is specified, the file will be downloaded to the current directory, under `System/Xml`.
If you want to downlodad it without a directory structure at all, to the current directory, you can pass `.`
as the target directory.
Once downloaded, [dotnet-file](https://github.com/devlooped/dotnet-file) creates (or updates) a
[dotnet-config](https://dotnetconfig.org/) file in the current directory named `.netconfig` as follows:
```
[file "src/Common/System/Xml/XmlWrappingReader.cs"]
url = https://github.com/devlooped/catbag/blob/main/System/Xml/XmlWrappingReader.cs
sha = 19be5e474022ab5b8993b29509a3929439f510e9
etag = a4dba639f18b47a9e480704abf86b1ba2582c54b76a520d7ed988aa1efcd7b8d
```
The `url` is used in combination with the `etag` to detect changes in the source file afterwards, whenever you
run `dotnet file update`. The `sha` is used if you pass a `-c|--changelog` file path to the command, which will
contain the diff between the local `sha` and the latest one at the source. See [PR#46](https://github.com/dotnetconfig/dotnet-config/pull/46) and [PR#40](https://github.com/devlooped/dotnet-file/pull/40) for example.
You can easily automate running these checks for updates in CI on a schedule, to automatically generate those
update PRs shown above. See [dotnet-file.yml](https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file.yml) as an example
that does this using GitHub Actions.
# Sponsors
[](https://github.com/clarius)
[](https://github.com/MFB-Technologies-Inc)
[](https://github.com/torutek-gh)
[](https://github.com/drivenet)
[](https://github.com/Keflon)
[](https://github.com/tbolon)
[](https://github.com/kfrancis)
[](https://github.com/twenzel)
[](https://github.com/unoplatform)
[](https://github.com/dansiegel)
[](https://github.com/rbnswartz)
[](https://github.com/jfoshee)
[](https://github.com/Mrxx99)
[](https://github.com/eajhnsn1)
[](https://github.com/IxTechnologies)
[](https://github.com/davidjenni)
[](https://github.com/Jonathan-Hickey)
[](https://github.com/akunzai)
[](https://github.com/jakobt)
[](https://github.com/tinohager)
[](https://github.com/KenBonny)
[](https://github.com/SimonCropp)
[](https://github.com/agileworks-eu)
[](https://github.com/sorahex)
[](https://github.com/arsdragonfly)
[](https://github.com/vezel-dev)
[](https://github.com/ChilliCream)
[](https://github.com/4OTC)
[](https://github.com/v-limo)
[](https://github.com/jordansjones)
[](https://github.com/DominicSchell)
[](https://github.com/jkingry)
[](https://github.com/sponsors/devlooped)
[Learn more about GitHub Sponsors](https://github.com/sponsors)