Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dummy desk files for testing #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ usage() {
echo -e "Options:"
echo -e " -h\tPrint script usage info"
echo -e " -d\tName of desk to which to install (default: $DEFAULT_DESK)"
echo -e " -k\tInstall dummy desk data for testing on Urbit"
echo -e " -p\tPath to root pier directory (default: $DEFAULT_PIER)"
echo -e " -s\tName of ship to install to (default: $DEFAULT_SHIP)"
echo -e ""
Expand All @@ -43,6 +44,7 @@ SCRIPT_NAME=$(basename $0 | cut -d '.' -f 1)

SCRIPT_DIR=$(dirname $0)
ROOT_DIR=$(dirname $SCRIPT_DIR)
RESOURCE_DIR="$ROOT_DIR/resources"
CHESS_DIR="$ROOT_DIR/src/chess"
DEPS_DIR="$ROOT_DIR/src/dependencies"

Expand All @@ -53,12 +55,14 @@ DESK=$DEFAULT_DESK
PIER=$DEFAULT_PIER
SHIP=$DEFAULT_SHIP

DOCKET=0

# --------------------------------------
# MAIN
# --------------------------------------

# Parse arguments
OPTS=":hd:p:s:"
OPTS=":hd:kp:s:"
while getopts ${OPTS} opt; do
case ${opt} in
h)
Expand All @@ -67,6 +71,9 @@ while getopts ${OPTS} opt; do
d)
DESK=$OPTARG
;;
k)
DOCKET=1
;;
p)
PIER=$OPTARG
;;
Expand All @@ -86,7 +93,21 @@ done

# Copy files
INSTALL_DIR="$PIER/$SHIP/$DESK"

echo "Attempting to install to path '$INSTALL_DIR'"

cp -rfL ${CHESS_DIR}/* ${INSTALL_DIR}/
cp -rfL ${DEPS_DIR}/* ${INSTALL_DIR}/

if [ $DOCKET -eq 1 ]; then
cp -rfL ${RESOURCE_DIR}/* ${INSTALL_DIR}/
DOCKET_FILE="${INSTALL_DIR}/desk.docket-0"

echo "\n" >> $DOCKET_FILE
Copy link
Collaborator

@bonbud-macryg bonbud-macryg May 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to change to this to get it working on macOS, otherwise it added the text \n in there.

echo ""                         >> $DOCKET_FILE

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this didn't come up testing #13. I just tried installing with -k on a new fakeship working from the develop branch and got this in there too.

:~
  title+'Chess'
  info+'Fully peer-to-peer chess over Urbit'
  color+0xff.ffff
  image+'https://peekabooo.icu/images/finmep-chess.svg'
  base+'chess'
  version+[0 0 1]
  license+'GPL3'
  website+'https://github.com/thecommons-urbit/chess'\n
  glob-ames+[~fun 0v0]
==

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So odd - I tested it locally, and my test file didn't have this issue

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be an OS thing. Does it make a difference in Linux if you replace the "\n" with ""?

echo " glob-ames+[~$SHIP 0v0]" >> $DOCKET_FILE
echo "==" >> $DOCKET_FILE

echo "~$SHIP" > "${INSTALL_DIR}/desk.ship"
fi

echo "Successfully installed to path '$INSTALL_DIR'"
1 change: 1 addition & 0 deletions resources/desk.bill
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:~ %chess ==
9 changes: 9 additions & 0 deletions resources/desk.docket-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:~
title+'Chess'
info+'Fully peer-to-peer chess over Urbit'
color+0xff.ffff
image+'https://peekabooo.icu/images/finmep-chess.svg'
base+'chess'
version+[0 0 1]
license+'GPL3'
website+'https://github.com/thecommons-urbit/chess'
1 change: 1 addition & 0 deletions resources/sys.kelvin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[%zuse 411]