Skip to content

Commit

Permalink
0.1a-rc2
Browse files Browse the repository at this point in the history
- fixed modem script path issues with version
- cleaned up odd tabbing in code
- cleanup Makefile target deps

Signed-off-by: Dayton Pidhirney <[email protected]>
  • Loading branch information
watbulb committed Apr 8, 2019
1 parent ce763cc commit e83037a
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 62 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).

<img src="https://github.com/watbulb/ANSiTerm2/raw/master/.github/image/README.inline1.png" alt="d" width="600"/>
<br><br/>
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7350c86fd03c5e893495147ad62cea20c7bab312495e925ea6bd2b5e7b401e0f:0.1a-rc1
77c03c5f1a3720e009ffb9dfe0884c954efbe46905742ddd8d6286fafbefa80f:0.1a-rc2
44 changes: 22 additions & 22 deletions ansiterm2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
4 changes: 2 additions & 2 deletions profile/sh.potato.ansiterm2.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
26 changes: 10 additions & 16 deletions trigger/modem/iterm2-recv-zmodem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 9 additions & 15 deletions trigger/modem/iterm2-send-zmodem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e83037a

Please sign in to comment.