Skip to content

Instantly share code, notes, and snippets.

@ChlorUpload
Created July 5, 2022 08:21
Show Gist options
  • Save ChlorUpload/ff7966b8ae9d040063e4e8fb33eacee8 to your computer and use it in GitHub Desktop.
Save ChlorUpload/ff7966b8ae9d040063e4e8fb33eacee8 to your computer and use it in GitHub Desktop.
replace.py
import os
import sys
original = sys.argv[1]
dest = sys.argv[2]
txt = sys.stdin.read()
txt = txt.replace(original, dest)
print(txt)
"""
Usage
python replace.py
' Object.keys(input || {}).reduce((formData, key) => {'
' Object.keys(input || {}).filter((key) => input[key] !== undefined).reduce((formData, key) => {'
< src/common/api/types.ts
> new_types.ts
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment