fix shell quoting and use before_install hook