Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 77 lines (65 sloc) 1.705 kb
#!/usr/bin/env sh
platform="`uname -s`/`uname -m`"
case $platform in
(Darwin/i386|Darwin/x86_64|Linux/i386|Linux/x86_64)
true
;;
(Linux/i[456]86)
platform=Linux/i386
;;
(Linux/armv6l)
platform=Linux/arm
;;
(*)
echo "Unsupported platform: $platform."
exit 1
;;
esac
if test "${1:-}" = "--from"
then
sm_owner=${2:-}
shift 2
fi
if test "${1:-}" = "--path"
then
sm_path=${2:-}
shift 2
fi
if test -z "${sm_curl_command:-}"
then
if command -v curl >/dev/null
then sm_curl_command=curl
else
echo "Could not find curl, please install and try again."
exit 2
fi
fi
if test -z "${sm_tar_command:-}"
then
if command -v gtar >/dev/null
then sm_tar_command=gtar
elif command -v tar >/dev/null
then sm_tar_command=tar
else
echo "Could not find tar, please install and try again."
exit 3
fi
fi
if test -z "${sm_path:-}"
then # NOTE: We are using the bad practice of '`' here only for full POSIX compat
if test `ps -p $$ -o uid=` -eq 0
then sm_path=/opt/sm
else sm_path="${HOME:-}/.sm"
fi
fi
true sm_owner:${sm_owner:=sm}:
rm -rf "${sm_path}/src/${sm_owner}-sm"
mkdir -p "${sm_path}/archives" "${sm_path}/bin" "${sm_path}/src/${sm_owner}-sm" "${sm_path}/zsh/bin"
${sm_curl_command} https://smf.sh/zsh/$platform/zsh -o "${sm_path}/zsh/bin/zsh"
chmod +x "${sm_path}/zsh/bin/zsh"
${sm_curl_command} -L https://github.com/${sm_owner}/sm/tarball/master -o "${sm_path}/archives/${sm_owner}-sm.tar.gz"
cd "${sm_path}/src/${sm_owner}-sm"
${sm_tar_command} xzf "${sm_path}/archives/${sm_owner}-sm.tar.gz"
mv ${sm_owner}-sm-*/* .
rm -rf ${sm_owner}-sm-*
"${sm_path}/zsh/bin/zsh" ./install --zsh "${sm_path}/zsh/bin/zsh" "$@"
Jump to Line
Something went wrong with that request. Please try again.