From 1c4599d7e76b5d7c083bf60d9cf4368657a0c796 Mon Sep 17 00:00:00 2001 From: Max Cai Date: Mon, 6 Nov 2023 21:42:08 -0800 Subject: [PATCH] release 0.0.3 --- Formula/cowponder.rb | 4 +-- resources/Makefile | 27 ++++++++++++++--- resources/contents/cowponder | 32 ++++----------------- resources/cowponder-homebrew-v0.0.2.tar.gz | Bin 3882 -> 0 bytes resources/cowponder-homebrew-v0.0.3.tar.gz | Bin 0 -> 3841 bytes 5 files changed, 31 insertions(+), 32 deletions(-) delete mode 100644 resources/cowponder-homebrew-v0.0.2.tar.gz create mode 100644 resources/cowponder-homebrew-v0.0.3.tar.gz diff --git a/Formula/cowponder.rb b/Formula/cowponder.rb index e353f0c..45e630f 100644 --- a/Formula/cowponder.rb +++ b/Formula/cowponder.rb @@ -1,8 +1,8 @@ class Cowponder < Formula desc "Simple terminal command to display random philosophical thoughts from a cow" homepage "https://github.com/maxcai314/homebrew-cowponder" - url "https://max.xz.ax/cowponder/cowponder-homebrew-v0.0.2.tar.gz" - sha256 "9c0fdb7a962c858e69c3d10a6583da79217e13e6dc95fa7418e9e1e7830a0d44" + url "https://max.xz.ax/cowponder/cowponder-homebrew-v0.0.3.tar.gz" + sha256 "f9ba2818473e0b74d311a809a1c884ecedfeddfe3b62bf7dc898539a3d4e4ab5" depends_on "cowsay" depends_on "python@3" diff --git a/resources/Makefile b/resources/Makefile index a8e4296..306a2cc 100644 --- a/resources/Makefile +++ b/resources/Makefile @@ -1,7 +1,13 @@ CONTENTS_DIR := ./contents BUILD_DIR := . INSTALL_DIR := /var/www/max/cowponder -TARBALL_FILE := cowponder-homebrew-v0.0.2.tar.gz +TARBALL_FILE := cowponder-homebrew-v0.0.3.tar.gz + +PACKAGE_FILE := ../Formula/cowponder.rb + +# ANSI color codes +BLUE := \033[0;34m +RESET := \033[0m .PHONY: all clean install @@ -10,9 +16,22 @@ all: $(BUILD_DIR)/$(TARBALL_FILE) install: $(BUILD_DIR)/$(TARBALL_FILE) cp $^ $(INSTALL_DIR) +clean: + rm -f $(BUILD_DIR)/$(TARBALL_FILE) + +# build package and update checksum in ../Formula/cowponder.rb $(BUILD_DIR)/$(TARBALL_FILE): $(CONTENTS_DIR) tar -czvf $@ -C $^ . - shasum -a 256 $(BUILD_DIR)/$(TARBALL_FILE) -clean: - rm -f $(BUILD_DIR)/$(TARBALL_FILE) + new_checksum="$$(shasum -a 256 $@ | cut -d ' ' -f 1)" && \ + echo && printf "new checksum: $(BLUE)$$new_checksum$(RESET)\n" && echo && \ + awk -v new_checksum="$$new_checksum" '{ \ + if ($$1 == "sha256") { \ + print " sha256 \"" new_checksum "\""; \ + } else { \ + print; \ + } \ + }' $(PACKAGE_FILE) > $(PACKAGE_FILE).temp && \ + mv $(PACKAGE_FILE).temp $(PACKAGE_FILE) + + @echo "updated new checksum in $(BLUE)../Formula/cowponder.rb$(RESET)" diff --git a/resources/contents/cowponder b/resources/contents/cowponder index 2d97f62..0844848 100755 --- a/resources/contents/cowponder +++ b/resources/contents/cowponder @@ -1,7 +1,6 @@ #!/usr/bin/python3 import argparse -import requests import subprocess from random import SystemRandom from os import path, popen @@ -42,7 +41,6 @@ is the same software as cowponder and shares a thoughtbook. ap.add_argument("-v", "--version", action='store_true', help=argparse.SUPPRESS) ap.add_argument("-u", "--update", action='store_true', help=argparse.SUPPRESS) ap.add_argument("-a", "--add", help=argparse.SUPPRESS) -ap.add_argument("-h", "--help", action="store_true", help=argparse.SUPPRESS) arglist = 'bdgpsy' for i in arglist: ap.add_argument("-"+i, action="store_true", help=argparse.SUPPRESS) @@ -51,36 +49,18 @@ for i in arglist: args = vars(ap.parse_args()) -if args["help"]: - print(ap.description) - exit() - if args['version']: subprocess.run(["brew", "info", "cowponder"]) # print("cowponder version 0.0.1") exit() -if args['update']: - try: - response = requests.get('https://max.xz.ax/cowponder/cowthoughts.txt') - if response.status_code == 200: - with open(cowthoughts_path, 'w') as f: - f.write(response.text) - print("updated thoughtbook (moo)") - exit() - else: - print("failed to download cowthoughts.txt") - print("no changes written to local cowthoughts file") - exit() - except Exception as e: - print(f"Error while downloading cowthoughts.txt: {e}") - exit() +if thought := args["add"]: + subprocess.run(["ponder", "--add", thought]) + exit() -if thought := args['add']: - with open(cowthoughts_path, "a") as f: - print(thought, file=f) - subprocess.run(['cowthink', '"' + thought + '" added to thoughtbook']) - exit() +if args["update"]: + subprocess.run(["ponder", "--update"]) + exit() thought = subprocess.check_output("ponder", shell=True, stderr=subprocess.STDOUT, text=True) diff --git a/resources/cowponder-homebrew-v0.0.2.tar.gz b/resources/cowponder-homebrew-v0.0.2.tar.gz deleted file mode 100644 index 115b3c2b455bef7a63804acbf985c8c946a02423..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3882 zcmV+_57qD=iwFP!000001MOPNa@@uh<<|I$_INQvYdGYP5*f=Gr|ihKw24&~wMZ$9 z+ygX#76CNe-QaMP%J-zQ%RhLRugbZ%0nG3vTd`$F6?8cw0rcZO&po%9+5XNu9|ssG zClBc7{N%xvpWWD*-+yp8e{gaAbRc&ik?N z@9CKB$7bbo(`31KGk@vd!5QS>C+BgF5{0Q0 zZLca-s>+L8;z;F1xh9ztNF-J`RM|*b$d_9kD_-cDN+eh;oGcnIy~fFyOrH|Ds-jm) z)Y3vC{Fho;{qPS7ZDLbG@dnE-WQ?iG)iSG0p(0wiGB#Nnb1qCOoUzudXhoG4GPBUa z33H*W@Ve}$7m1L?O0FFgG3R6ljoREkb(_jLwa%f{=pDI)D9Z03;JI6s#cN?29GrkE#bfm1BDg4wV= zX%lO|-a|G(2^Jl~C6H)oWz64Mj8EBm^rbeC(G^P74u_3hrz9CNR(MWjQ~2l=5=@W} z5^HLKK!A3%1^uRLVNFvd2(FcOxxf$dAXKIqq=A+&Qm&LEXV7+fTq3yePL|{q1njc$ zg5JVQ_MBs91uaYecC{RSbh-B7!IC z@(u~wo)MoT3ilV4D>(2eL0UB`=}_ z4$%clho`JVej-G$TML&I!;%sVIs>tK&F7!|?moptt^M}Y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>!jjqt}_m?RSV;I92#xRC4jA0C87{eIG sForRVVGLs!!x+XehB1s`3}YC>7{)M$F^pjh<9~7d2fkxlKLAhw07s2e3;+NC diff --git a/resources/cowponder-homebrew-v0.0.3.tar.gz b/resources/cowponder-homebrew-v0.0.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bbfb578f35fd8e5da9c56737e90a4ad1abf82df0 GIT binary patch literal 3841 zcmV+c5B~5UiwFP!000001MON}bKFLD<*V^4ddCl(*&UAfB{7!6O?e}Gt(Vwk(GMv_ z(e?n1L7M;??gls#2n+;cHnJURI2 z;~3-O;we8*E}q``9LB-P`P0+Wv-4-C=Vu4UCnqP*&JWbnk1yK6K^I!>l{%>OZD@^u zbl!)a|DBG-lhm!-!gZ^n4U6`+{Rn5!!O!5(NBnu?$0)5zdt>WWVpV2RZ;WbPrZ=iBbc;v1;mTmE zro=scjhV7T?OL^p3!AP^+s>OzEp56f7S zv)0(xCwbYyj!**g{&19AQ)WTchNt!W28XS6*V?=*6WeOoEFiOSexYxS@}`1KF;8*@@_wYH&9_@D=&GG|Z&t6`+Vm_TQ6J9}6mxNuKb z^a=uY*|myy;U#}9v9pGjqJe&gxI;)ogE=JiJ?i2L_&BU#eudyt1ib)evZHgO$=A9@AAA4Ra4qq>nW2fd88!16{lht9qOtA%)RT*gXG!Ipiekc} z6eT+GN94ToqME=e%*=@J;_m*b)umc>2n^a^TTy3+;E?kgs$LuMo2E3&l4%B{GYKWl z0hxNP2qqi#+5F_Q)A_TrlljHPv2q~=QtJpy&;VMQV7p44oSiA0UCp_pNr?s&4dAhc zRbVsVSBmT_5d^$M!N8RTk_teGRZAOS$*stizF?@(CIVoIu5AV7as(k#b-9ESsu)8A z|I+A{Nl-FWMVM)w#Z(w8N1@7G1rQ2Q8}I}PO%)T#ZCJ+@9U{er$(}4dj>DnvAJG6E z4D(ahIH=YQGKpfYi&$!6tQR_y|ADr(0Ya`>fUsN88Pc1_BJ1IS5^^9tW3Y(CIpmB$ z066S%m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