erynwells.me/scripts/erynwells_me/scripting/command.py
Eryn Wells 2688e4e339 Add a deployment command group to the website script
This group has one command so far: next-tag. It looks at the git tag list and
figured out the next deployment tag. For the most part tags are named like so:

    deploy-%Y-%m-%d-NN

The middle segments are year-month-day, and the last segment is an incrementing
counter. For the most part this number will be 01. On days when I deploy more than
once, it will increment.
2025-08-29 08:59:03 -06:00

24 lines
634 B
Python

# Eryn Wells <eryn@erynwells.me>
import argparse
import re
class Command:
def __init__(self) -> None:
pass
@property
def name(self) -> str:
class_name = self.__class__.__name__
if class_name.endswith('Command'):
trimmed_class_name = class_name.removesuffix('Command')
hyphenated_name = re.sub(r'\B([A-Z])', r'-\1', trimmed_class_name)
return hyphenated_name.lower()
return class_name.lower()
@property
def help(self) -> str:
return ''
def add_arguments(self, parser: argparse.ArgumentParser):
raise NotImplementedError()