Skip to content
Browse files

Use actual file command, and only if it exists.

  • Loading branch information...
1 parent 68c65e4 commit 342691a411011c511c582a7bf926523dab1156dc @wayneeseguin wayneeseguin committed May 4, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 core/install/shell/functions
View
14 core/install/shell/functions
@@ -219,8 +219,11 @@ create_versionedfs_paths()
install_sm_mustache()
{
typeset _url
- if file "${install_path}/bin/sm-mustache" | grep 'perl' >/dev/null
- then file remove "${install_path}/bin/sm-mustache"
+ if [[ -s "${install_path}/bin/sm-mustache" ]]
+ then
+ if $(command file) "${install_path}/bin/sm-mustache" | grep 'perl' >/dev/null
+ then file remove "${install_path}/bin/sm-mustache"
+ fi
fi
if ! file is executable "${install_path}/bin/sm-mustache"
@@ -237,8 +240,11 @@ install_sm_json()
{
return 0 # Remove this line once sm-json is ready.
typeset _url
- if file "${install_path}/bin/sm-json" | grep 'perl' >/dev/null
- then file remove "${install_path}/bin/sm-json"
+ if [[ -s "${install_path}/bin/sm-json" ]]
+ then
+ if $(command file) "${install_path}/bin/sm-json" | grep 'perl' >/dev/null
+ then \file remove "${install_path}/bin/sm-json"
+ fi
fi
if ! file is executable "${install_path}/bin/sm-json"

0 comments on commit 342691a

Please sign in to comment.
Something went wrong with that request. Please try again.