Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisrapin committed Oct 11, 2019
0 parents commit a853c38
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
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>
```
36 changes: 36 additions & 0 deletions bin/renkuize_packrat.sh
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

0 comments on commit a853c38

Please sign in to comment.