Skip to content

Commit

Permalink
add utils to NAMESPACE
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilseth committed Apr 15, 2016
1 parent ee82f42 commit 0889ea7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Package: funr
Title: Simple Utility Providing Terminal Access to all R Functions
Description: A small utility which wraps Rscript and provides access to all R
functions from the shell.
Version: 0.3.0
Version: 0.3.1
Authors@R: person("Sahil", "Seth", email = "[email protected]", role = c("aut", "cre"))
License: MIT + file LICENSE
LazyData: true
Imports:
utils
URL: https://github.com/sahilseth/funr
BugReports: https://github.com/sahilseth/funr/issues
RoxygenNote: 5.0.1
RoxygenNote: 5.0.1.9000
Suggests:
testthat
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export(sys.script)
importFrom(utils,head)
importFrom(utils,help)
importFrom(utils,str)
importFrom(utils,tail)
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
funr 0.3.0
----------------------------------------------
- **NEW**: A new function, to detect the path, where R script resides.
This is similar to `$0` in bash scripting.
This functionality is missing in R
- better error messages in case of failures

funr 0.2.0
Expand Down
9 changes: 7 additions & 2 deletions R/detect_home.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

utils::globalVariables(c(".home"))
utils::suppressForeignCheck(".home")

#' Enables detection of the folder a script resides in with certain accuracy
#'
#' R does not have a default way to return and use, the location of a specific script.
#'
#' @export
#'
#' @importFrom utils tail
#'
#' @source https://github.com/molgenis/molgenis-pipelines/wiki/How-to-source-another_file.R-from-within-your-R-script
get_script_path <- function(){
this.file = NULL
Expand All @@ -28,7 +31,9 @@ get_script_path <- function(){

if (length(res) > 0){
res = tools::file_path_as_absolute(dirname(res))
.home <<- res
#assign(.home, res, envir = .GlobalEnv)
#.home <<- res

return(res)
}

Expand Down

0 comments on commit 0889ea7

Please sign in to comment.