Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unfor19/replacer
Find and replace multiline strings
https://github.com/unfor19/replacer
Last synced: about 1 month ago
JSON representation
Find and replace multiline strings
- Host: GitHub
- URL: https://github.com/unfor19/replacer
- Owner: unfor19
- License: mit
- Created: 2020-07-30T22:08:57.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-01T21:43:27.000Z (about 4 years ago)
- Last Synced: 2024-07-30T05:36:57.216Z (about 2 months ago)
- Language: Shell
- Size: 42 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# replacer
[![testing](https://github.com/unfor19/replacer/workflows/testing/badge.svg)](<(https://github.com/unfor19/replacer/actions?query=workflow%3Atesting)>)
Find and replace multiline strings
## Requirements
All you need is [Docker](https://docs.docker.com/get-docker/)
## Getting Started
1. Insert a start tag and stop tag to a text file, for example
```html
This is the text block that will be replacedLet's make it work!```
2. Prepare a file with the text that you want to inject
```bash
$ echo -e 'This is the incoming text block\nIt worked!' > incoming.txt
```3. Run the application
```bash
$ docker run --rm -v ${PWD}/:/app unfor19/replacer -sf /app/incoming.txt -df /app/README.md
```4. That's it, your text has been replaced! To see more options
```bash
$ docker run --rm -v ${PWD}/:/app unfor19/replacer --helpUsage: bash main.sh -sf incoming.txt -df README.md
--dst_file_path | -df [REQUIRED] Full path to destination file
--src_file_path | -sf [replacer_null] Full path to source file that will be injected
--src_text | -st [replacer_null] Text of the source to inject
--start_value | -sv [] From where to start
--end_value | -ev [] Where to stop
--create_backup | -cb [true] Create a backup file
--backup_file_path | -bp [./] Full path to backup file```
_NOTE_: the code block above :point_up: was automatically generated with replacer! See the raw version of this [README.md](https://raw.githubusercontent.com/unfor19/replacer/master/README.md) file and [update_readme.sh](https://github.com/unfor19/replacer/blob/master/scripts/update_readme.sh)
## Authors
Created and maintained by [Meir Gabay](https://github.com/unfor19)
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/unfor19/replacer/blob/master/LICENSE) file for details