Skip to content

Commit

Permalink
TASK: improve synco serve and synco commands
Browse files Browse the repository at this point in the history
  • Loading branch information
skurfuerst committed Jul 10, 2023
1 parent 53f624f commit 6d27552
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
34 changes: 17 additions & 17 deletions docs/serve
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ BIN_TARGET="synco-lite"

echo "This downloads and executes '$BIN_TARGET serve $@' in the current directory."

if [ ! -f "$BIN_TARGET" ]; then
OS_TYPE=$(uname -s)
ARCH_TYPE=$(uname -m)
# we always want to re-download synco
rm -Rf "$BIN_TARGET"
OS_TYPE=$(uname -s)
ARCH_TYPE=$(uname -m)

if [ "$OS_TYPE" = "FreeBSD" ]; then
if [ "$ARCH_TYPE" = "amd64" ]; then
# inconsistency between platforms: on Linux, the architecture reports as x86_64.
# on FreeBSD, it reports as amd64.
#
# we use the linux convention as filename convention; so we need to map the FreeBSD convention to
# the Linux convention (amd64 => x86_64)
ARCH_TYPE=x86_64
fi
if [ "$OS_TYPE" = "FreeBSD" ]; then
if [ "$ARCH_TYPE" = "amd64" ]; then
# inconsistency between platforms: on Linux, the architecture reports as x86_64.
# on FreeBSD, it reports as amd64.
#
# we use the linux convention as filename convention; so we need to map the FreeBSD convention to
# the Linux convention (amd64 => x86_64)
ARCH_TYPE=x86_64
fi

DOWNLOAD_LINK="https://github.com/sandstorm/synco/releases/latest/download/synco-lite_${OS_TYPE}_${ARCH_TYPE}"
echo "Downloading $DOWNLOAD_LINK"
curl -L -o $BIN_TARGET "$DOWNLOAD_LINK"
chmod +x $BIN_TARGET
fi

DOWNLOAD_LINK="https://github.com/sandstorm/synco/releases/latest/download/synco-lite_${OS_TYPE}_${ARCH_TYPE}"
echo "Downloading $DOWNLOAD_LINK"
curl -L -o $BIN_TARGET "$DOWNLOAD_LINK"
chmod +x $BIN_TARGET

./$BIN_TARGET serve $@
36 changes: 18 additions & 18 deletions docs/synco
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ BIN_TARGET="synco"

echo "This downloads and executes '$BIN_TARGET $@' in the current directory."

if [ ! -f "$BIN_TARGET" ]; then
OS_TYPE=$(uname -s)
ARCH_TYPE=$(uname -m)
# we always want to re-download synco
rm -Rf "$BIN_TARGET"
OS_TYPE=$(uname -s)
ARCH_TYPE=$(uname -m)

if [ "$OS_TYPE" = "FreeBSD" ]; then
if [ "$ARCH_TYPE" = "amd64" ]; then
# inconsistency between platforms: on Linux, the architecture reports as x86_64.
# on FreeBSD, it reports as amd64.
#
# we use the linux convention as filename convention; so we need to map the FreeBSD convention to
# the Linux convention (amd64 => x86_64)
ARCH_TYPE=x86_64
fi
if [ "$OS_TYPE" = "FreeBSD" ]; then
if [ "$ARCH_TYPE" = "amd64" ]; then
# inconsistency between platforms: on Linux, the architecture reports as x86_64.
# on FreeBSD, it reports as amd64.
#
# we use the linux convention as filename convention; so we need to map the FreeBSD convention to
# the Linux convention (amd64 => x86_64)
ARCH_TYPE=x86_64
fi

DOWNLOAD_LINK="https://github.com/sandstorm/synco/releases/latest/download/synco_${OS_TYPE}_${ARCH_TYPE}"
echo "Downloading $DOWNLOAD_LINK"
curl -L -o $BIN_TARGET "$DOWNLOAD_LINK"
chmod +x $BIN_TARGET
fi

./$BIN_TARGET $@
DOWNLOAD_LINK="https://github.com/sandstorm/synco/releases/latest/download/synco_${OS_TYPE}_${ARCH_TYPE}"
echo "Downloading $DOWNLOAD_LINK"
curl -L -o $BIN_TARGET "$DOWNLOAD_LINK"
chmod +x $BIN_TARGET

exec ./$BIN_TARGET $@

0 comments on commit 6d27552

Please sign in to comment.