Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:sm/sm

  • Loading branch information...
commit 1e2db19c3a061be2a6f34ecfb3618489d80546ac 2 parents 5fc7448 + 896cd31
@wayneeseguin wayneeseguin authored
Showing with 23 additions and 30 deletions.
  1. +17 −24 bin/sm-installer
  2. +6 −6 install
View
41 bin/sm-installer
@@ -12,28 +12,21 @@ case $platform in
;;
esac
-params=()
-while test $# -gt 0
-do
- case "${1:-}" in
- (--from)
- sm_owner=${2:-}
- shift 2
- ;;
- (--path)
- sm_path=${2:-}
- shift 2
- ;;
- (*)
- params+=( "$1" )
- shift
- ;;
- esac
-done
+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 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."
@@ -43,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."
@@ -55,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
@@ -68,8 +61,8 @@ 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-*
-"${sm_path}/zsh-bin/zsh" ./install --zsh "${sm_path}/zsh-bin/zsh" "${params[@]}"
+"${sm_path}/zsh-bin/zsh" ./install --zsh "${sm_path}/zsh-bin/zsh" "$@"
View
12 install
@@ -2,12 +2,6 @@
extension_args=()
-if ! command -v zsh >/dev/null
-then
- echo "ERROR: ZSH is required for SM."
- exit 1
-fi
-
while (( $# ))
do
case "$1" in
@@ -54,6 +48,12 @@ do
esac
done
+if [[ -z "${sm_shell:-}" ]] && ! command -v zsh >/dev/null
+then
+ echo "ERROR: ZSH is required for SM."
+ exit 1
+fi
+
if [[ -n "${prefix_path}" ]]
then
sm_path="${DESTROOT:-}${prefix_path}/sm"
Please sign in to comment.
Something went wrong with that request. Please try again.