From 4916c1972f0a3d44e678540ebaab739347216883 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 6 Jul 2021 13:21:31 +0200 Subject: [PATCH] Init --- README.md | 3 +++ migrations/internaltrue.py | 13 +++++++++++++ tyop.py | 24 ++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 README.md create mode 100644 migrations/internaltrue.py create mode 100644 tyop.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..8739b4c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# tyop + +Automated your mass typo updates. diff --git a/migrations/internaltrue.py b/migrations/internaltrue.py new file mode 100644 index 0000000..de83e48 --- /dev/null +++ b/migrations/internaltrue.py @@ -0,0 +1,13 @@ +from tyop import Migration + + +class InternalTrueMigration(Migration): + """Add `internal: true` to all internal network definitions.""" + + GLOB = "~/.abra/apps/**/**.yml" + + def migrate(compose): + pass + + +InternalTrueMigration() diff --git a/tyop.py b/tyop.py new file mode 100644 index 0000000..72c8104 --- /dev/null +++ b/tyop.py @@ -0,0 +1,24 @@ +"""Automated your mass typo updates.""" + +from sys import exit + + +class Migration: + def __init__(self): + self.validate() + self.run() + + def validate(self): + if not hasattr(self, "GLOB"): + print("Define `GLOB` on your migration!") + exit(1) + + def run(self): + pass + # TODO: + # For each path in the GLOB + # Load it and pass it into the migrate function + # Once it comes back, save the contents back to the FS + # Run a diff without pager and ask whether that looks ok + # After like 3 tries, ask if "this looks ok" + skip the rest + # Run through each repo and ask to commit + push