From 3091eef2f2c0428d123ee1474c012ec194b12a45 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sat, 21 Feb 2015 20:49:48 +0000 Subject: [PATCH] after local install, script to PATH * if the installed file is a script in the json file, after install, a symbolic link is made from deps/package_name/script.sh -> deps/bin/script and the script get user execution permissions --- lib/install/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/install/install.sh b/lib/install/install.sh index b06fd92..73d60a8 100755 --- a/lib/install/install.sh +++ b/lib/install/install.sh @@ -339,6 +339,9 @@ bpkg_install_from_remote () { ## make `deps/' directory if possible mkdir -p "${cwd}/deps/${name}" + ## make `deps/bin' directory if possible + mkdir -p "${cwd}/deps/bin" + ## copy package.json over curl $auth_param -sL "${url}/package.json" -o "${cwd}/deps/${name}/package.json" @@ -349,6 +352,10 @@ bpkg_install_from_remote () { info "fetch" "${url}/${script}" info "write" "${cwd}/deps/${name}/${script}" curl $auth_param -sL "${url}/${script}" -o "${cwd}/deps/${name}/${script}" + local scriptname="${script%.*}" + info "${scriptname} to PATH" "${cwd}/deps/bin/${scriptname}" + ln -si "${cwd}/deps/${name}/${script}" "${cwd}/deps/bin/${scriptname}" + chmod u+x "${cwd}/deps/bin/${scriptname}" ) done fi