Compare commits

..

1 Commits

Author SHA1 Message Date
4d705e267e rewrite in python -- mostly feature complete 2025-01-05 15:16:17 -06:00
2 changed files with 3 additions and 19 deletions

View File

@ -5,10 +5,7 @@ import sys
import os import os
def main(args=sys.argv): def main(args=sys.argv):
try: command = args[1]
command = args[1]
except IndexError:
command = "nonexistent"
if command == "rebuild": if command == "rebuild":
cwd = os.getcwd() cwd = os.getcwd()
@ -18,16 +15,3 @@ def main(args=sys.argv):
os.execv('/bin/sh', ['/bin/sh', '.deploy']) os.execv('/bin/sh', ['/bin/sh', '.deploy'])
elif command == "update": elif command == "update":
sssg.liveupdate.liveupdate() sssg.liveupdate.liveupdate()
else:
help_text = """
sssg - the stupid static site generator
usage: sssg [verb]
verb: one of
rebuild -- rebuilds the static site into output/
deploy -- executes the deploy script
update -- rebuild the static site upon any change
"""
print(help_text)

View File

@ -42,8 +42,8 @@ BlogConverter = BasicConverter
class BinaryConverter(Converter): class BinaryConverter(Converter):
def realize_to_output(self: Self): def realize_to_output(self: Self):
with open(self.document.file_path, "rb") as origin: with open(self.document.file_path, "r") as origin:
with open(self.document.result_path, "wb") as target: with open(self.document.result_path, "w") as target:
target.write(origin.read()) target.write(origin.read())
class SensibleConverterConfiguration(ConverterConfiguration): class SensibleConverterConfiguration(ConverterConfiguration):