This repository has been archived by the owner on Mar 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a853c38
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# A toolbox to work on Renku | ||
|
||
`renkuize_packrat.sh` enables using packrat libraries built by the Dockerfile. | ||
|
||
``` | ||
$ renkuize_packrat.sh </path/to/R/project> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
#renkuize_packrat.sh | ||
|
||
# Error | ||
err() { | ||
echo "Error: $@" >&2 | ||
exit 1 | ||
} | ||
|
||
# Main | ||
# (1) proj_dir project directory path | ||
main() { | ||
|
||
local proj_dir | ||
proj_dir="${1}" | ||
[[ ! -d "${proj_dir}" ]] && err "Directory not found: ${proj_dir}" | ||
|
||
local packrat_dir | ||
packrat_dir=/home/rstudio/packrat | ||
[[ ! -d "${packrat_dir}" ]] && err "Directory not found: ${packrat_dir}" | ||
|
||
local libs | ||
libs=($(ls -d "${packrat_dir}"/lib*)) | ||
for l in "${libs[@]}"; do | ||
rm -r "${proj_dir}"/packrat/$(basename "${l}") && \ | ||
echo "Removed ${proj_dir}/packrat/$(basename ${l})" | ||
ln -s "${l}" "${proj_dir}"/packrat/$(basename "${l}") && \ | ||
echo "Created symlink ${proj_dir}/packrat/$(basename ${l})->${l}" | ||
done | ||
|
||
return 0 | ||
} | ||
|
||
main "${@}" | ||
|
||
exit 0 |