Permalink
Browse files

fix (da)sh compatibility

  • Loading branch information...
mpapis committed Apr 26, 2012
1 parent e80c89b commit 62b0016189df22587bd4414ab9c92b6e2ee1b44d
Showing with 5 additions and 5 deletions.
  1. +5 −5 bin/sm-installer
View
@@ -26,7 +26,7 @@ fi
if test -z "${sm_curl_command:-}"
then
- if builtin command -v curl >/dev/null
+ if command -v curl >/dev/null
then sm_curl_command=curl
else
echo "Could not find curl, please install and try again."
@@ -36,9 +36,9 @@ fi
if test -z "${sm_tar_command:-}"
then
- if builtin command -v gtar >/dev/null
+ if command -v gtar >/dev/null
then sm_tar_command=gtar
- elif builtin command -v tar >/dev/null
+ elif command -v tar >/dev/null
then sm_tar_command=tar
else
echo "Could not find tar, please install and try again."
@@ -48,7 +48,7 @@ fi
if test -z "${sm_path:-}"
then
- if test ${UID:-0} -eq 0
+ if test `ps -p $$ -o uid=` -eq 0
then sm_path=/opt/sm
else sm_path="${HOME:-}/.sm"
fi
@@ -61,7 +61,7 @@ mkdir -p "${sm_path}/archives" "${sm_path}/zsh-bin" "${sm_path}/src/${sm_owner}-
${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"
-builtin cd "${sm_path}/src/${sm_owner}-sm"
+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-*

0 comments on commit 62b0016

Please sign in to comment.