From e83037a9e8008174c5149159b8ebdd9e2d2b614b Mon Sep 17 00:00:00 2001 From: Dayton Pidhirney Date: Sun, 7 Apr 2019 23:44:40 -0600 Subject: [PATCH] 0.1a-rc2 - fixed modem script path issues with version - cleaned up odd tabbing in code - cleanup Makefile target deps Signed-off-by: Dayton Pidhirney --- Makefile | 5 +--- README.md | 4 +-- VERSION | 2 +- ansiterm2.rb | 44 ++++++++++++++--------------- profile/sh.potato.ansiterm2.plist | 4 +-- trigger/modem/iterm2-recv-zmodem.sh | 26 +++++++---------- trigger/modem/iterm2-send-zmodem.sh | 24 ++++++---------- 7 files changed, 47 insertions(+), 62 deletions(-) diff --git a/Makefile b/Makefile index 88d8d9c..9daeaa0 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ OBJ := ansiterm2.tar.gz ansiterm2.tar.gz: tar -cjf $@ $(SRC) - + # when installing locally we need to update the formula to point to local URL update_localurl: sed -i '' -e 's_url.*\".*_url $(LOCAL_ARCHIVE)_g' $(LOCAL_FORMULA) @@ -39,18 +39,15 @@ all: clean $(OBJ) test: ## test client functionality (execute from inside ANSiTerm2) -test: all @echo "[-] ERROR: Currently not implemented!" @exit 1 brewtest: ## test brew formula creation/installation -brewtest: install brew audit $(LOCAL_FORMULA) install: ## install ANSiTerm2 regularly (using git) -install: all @HOMEBREW_INSTALL_BADGE="📟" \ HOMEBREW_NO_AUTO_UPDATE=1 \ brew install -s $(GIT_FORMULA) diff --git a/README.md b/README.md index e320d88..fad22b8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# 📟 ANSiTerm2 (0.1a-rc1) +# 📟 ANSiTerm2 (0.1a-rc2) _ANSiTerm2_ is a set of profiles, triggers and meticulous tweaks that turn [_iTerm2_](https://www.iterm2.com) into -a fully fledged modern BBS client! Want to learn more? Check out the [wiki](https://github.com/watbulb/ANSiTerm2/wiki)! +a fully fledged modern BBS client; modem support included! If you want to learn more, head over to the [wiki](https://github.com/watbulb/ANSiTerm2/wiki). d

diff --git a/VERSION b/VERSION index 42a4b17..f21b3b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7350c86fd03c5e893495147ad62cea20c7bab312495e925ea6bd2b5e7b401e0f:0.1a-rc1 +77c03c5f1a3720e009ffb9dfe0884c954efbe46905742ddd8d6286fafbefa80f:0.1a-rc2 diff --git a/ansiterm2.rb b/ansiterm2.rb index fa8ae4f..6168137 100644 --- a/ansiterm2.rb +++ b/ansiterm2.rb @@ -7,55 +7,55 @@ class Ansiterm2 < Formula Author: Dayton Pidhirney (watbulb) " homepage "https://www.phenomprod.com/" - url "https://github.com/watbulb/ANSiTerm2/releases/download/#{version}/ansiterm2.tar.gz" - version "0.1a-rc1" - sha256 "7350c86fd03c5e893495147ad62cea20c7bab312495e925ea6bd2b5e7b401e0f" + version "0.1a-rc2" + url "https://github.com/watbulb/ANSiTerm2/releases/download/0.1a-rc2/ansiterm2.tar.gz" + sha256 "77c03c5f1a3720e009ffb9dfe0884c954efbe46905742ddd8d6286fafbefa80f" bottle :unneeded - + # lrzsz is required for zmodem transfers depends_on "lrzsz" - + # telnet is required for connecting to remote terminals depends_on "telnet" - - def install + + def install # @XXX: rather poor way to check for Cask dependency # since brew doesn't support formulas which depend # on Casks, sadly... - system "/usr/local/bin/brew", "cask", "install", "iterm2" - + system "/usr/local/bin/brew", "cask", "install", "iterm2" + # install Amiga fonts: # @XXX: a Cask is required to write to ~/Library/Fonts # so for now we just prompt the user to install topaz - # if it doesn't yet exist + # if it doesn't yet exist username = ENV["USER"] fontprompt = false - if not(File.exist?("/Users/#{username}/Library/Fonts/TopazPlus_a1200_v1.0.ttf")) - %x(open font/TopazPlus_a1200_v1.0.ttf) - fontprompt = true - end - - # replace the dynamic_profile username in the ANSiTerm2 profile - profile = "profile/sh.potato.ansiterm2.plist" - IO.write(profile, File.open(profile) do |f| + if not(File.exist?("/Users/#{username}/Library/Fonts/TopazPlus_a1200_v1.0.ttf")) + system "open", "font/TopazPlus_a1200_v1.0.ttf" + fontprompt = true + end + + # replace the dynamic_profile username in the ANSiTerm2 profile + profile = "profile/sh.potato.ansiterm2.plist" + IO.write(profile, File.open(profile) do |f| f.read.gsub("replacement_user", username) end) - + # install ANSiTerm2 to formula share share.mkpath share.install "docs" share.install "font" share.install "trigger" share.install "profile" - - # prompt for font installation and iTerm2 configuration documentation + + # prompt for font installation and iTerm2 configuration documentation if(fontprompt) puts puts "A FontBook window should have appeared!" puts "Please install the required Amiga font onto your system!" puts '(simply click "Install Font" within the FontBook window)' end - + puts puts "Please run the following command to 'activate' or 'update' ANSiTerm2:" puts "cp #{share}/profile/* ~/Library/Application\\ Support/iTerm2/DynamicProfiles/" diff --git a/profile/sh.potato.ansiterm2.plist b/profile/sh.potato.ansiterm2.plist index efbc425..c78b262 100644 --- a/profile/sh.potato.ansiterm2.plist +++ b/profile/sh.potato.ansiterm2.plist @@ -321,13 +321,13 @@ "Triggers" : [ { "action" : "MuteCoprocessTrigger", - "parameter" : "\/usr\/local\/Cellar\/ansiterm2\/0.1a\/share\/trigger\/modem\/iterm2-recv-zmodem.sh", + "parameter" : "\/usr\/local\/Cellar\/ansiterm2\/0.1a-rc2\/share\/trigger\/modem\/iterm2-recv-zmodem.sh", "regex" : "\\\\*\\\\*B00000000000000", "partial" : true }, { "partial" : true, - "parameter" : "\/usr\/local\/Cellar\/ansiterm2\/0.1a\/share\/trigger\/modem\/iterm2-send-zmodem.sh", + "parameter" : "\/usr\/local\/Cellar\/ansiterm2\/0.1a-rc2\/share\/trigger\/modem\/iterm2-send-zmodem.sh", "regex" : "\\\\*\\\\*B0100", "action" : "MuteCoprocessTrigger" }, diff --git a/trigger/modem/iterm2-recv-zmodem.sh b/trigger/modem/iterm2-recv-zmodem.sh index b244429..a22e478 100755 --- a/trigger/modem/iterm2-recv-zmodem.sh +++ b/trigger/modem/iterm2-recv-zmodem.sh @@ -3,25 +3,19 @@ INSTALLED="$(osascript -e 'tell application "iTerm2" to version')" FILE=$( osascript -e 'tell application "iTerm2" to activate' \ - -e 'tell application "iTerm2" to set thefile to choose folder with prompt "Choose a folder to place received files in"' \ - -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")" + -e 'tell application "iTerm2" to set thefile to choose folder with prompt "Choose a folder to place received files in"' \ + -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")" ) if [ ! "${INSTALLED}" ]; then - echo "[-] FATAL: Somehow iTerm2 is not installed! Aborting!" - exit 1 + echo "[-] FATAL: Somehow iTerm2 is not installed! Aborting!" + exit 1 elif [ ! "${FILE}" ]; then - # send zmodem cancel if user cancelled prompt - print \\x18\\x18\\x18\\x18\\x18 && sleep 1 - echo - echo - echo + # send zmodem cancel if user cancelled prompt + print \\x18\\x18\\x18\\x18\\x18 && sleep 1 + echo; echo; echo else - cd "${FILE}" || : - /usr/local/bin/rz -E -e -b && sleep 1 - echo - echo - echo + cd "${FILE}" || : + /usr/local/bin/rz -E -e -b && sleep 1 + echo; echo; echo fi - -# vim: ts=4 sw=4 et diff --git a/trigger/modem/iterm2-send-zmodem.sh b/trigger/modem/iterm2-send-zmodem.sh index c7ed5df..440fbfe 100755 --- a/trigger/modem/iterm2-send-zmodem.sh +++ b/trigger/modem/iterm2-send-zmodem.sh @@ -3,24 +3,18 @@ INSTALLED="$(osascript -e 'tell application "iTerm2" to version')" FILE=$( osascript -e 'tell application "iTerm2" to activate' \ - -e 'tell application "iTerm2" to set thefile to choose file with prompt "Choose a file to send"' \ - -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")" + -e 'tell application "iTerm2" to set thefile to choose file with prompt "Choose a file to send"' \ + -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")" ) if [ ! "${INSTALLED}" ]; then - echo "[-] FATAL: Somehow iTerm2 is not installed! Aborting!" - exit 1 + echo "[-] FATAL: Somehow iTerm2 is not installed! Aborting!" + exit 1 elif [ ! "${FILE}" ]; then - # send zmodem cancel if user cancelled prompt - print \\x18\\x18\\x18\\x18\\x18 && sleep 1 - echo - echo - echo + # send zmodem cancel if user cancelled prompt + print \\x18\\x18\\x18\\x18\\x18 && sleep 1 + echo; echo; echo else - /usr/local/bin/sz -E -e -b -8 "${FILE}" && sleep 1 - echo - echo - echo + /usr/local/bin/sz -E -e -b -8 "${FILE}" && sleep 1 + echo; echo; echo fi - -# vim: ts=4 sw=4 et