GithubHelp home page GithubHelp logo

replacer's Introduction

replacer

testing

Find and replace multiline strings

Requirements

All you need is Docker

Getting Started

  1. Insert a start tag and stop tag to a text file, for example
<!-- replacer_start -->

<div>This is the text block that will be replaced</div>
<div>Let's make it work!</div>

<!-- replacer_end -->
  1. Prepare a file with the text that you want to inject
$ echo -e '<div>This is the incoming text block</div>\n<div>It worked!</div>' > incoming.txt
  1. Run the application
$ docker run --rm -v ${PWD}/:/app unfor19/replacer -sf /app/incoming.txt -df /app/README.md
  1. That's it, your text has been replaced! To see more options
$ docker run --rm -v ${PWD}/:/app unfor19/replacer --help

Usage: 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  [<!-- replacer_start -->]  From where to start
	--end_value         |  -ev  [<!-- replacer_end -->]    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 ☝️ was automatically generated with replacer! See the raw version of this README.md file and update_readme.sh

Authors

Created and maintained by Meir Gabay

License

This project is licensed under the MIT License - see the LICENSE file for details

replacer's People

Contributors

unfor19 avatar

Stargazers

Daniel Bodnar avatar Chris Green avatar  avatar manuel.cruanes avatar Alistair Scott avatar ~hedy avatar  avatar Marcel Brückner avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.