Skip to content

proj_path() not necessarily absolutized for create_*() #227

@adomingues

Description

@adomingues

Maybe this is an intended behaviour, but I am not sure and this report. Reproducible example:
(using console R)

library(usethis)
pkg_dir <- file.path(".", "testLicense")
create_package(pkg_dir)
Changing active project to testLicenseCreating 'R/'Creating 'man/'Writing 'DESCRIPTION'Writing 'NAMESPACE'Changing working directory to './testLicense'

use_mit_license("António Domingues")
# Error: File file does not exist
getwd()
[1] "/home/adomingu/sandbox/testLicense"

The error is also a little strange, File file does not exist (sic).

If I now change to the package directory, outside R:

cd /home/adomingu/sandbox/testLicense
R
library(usethis)
use_mit_license("António Domingues")
✔ Setting License field in DESCRIPTION to 'MIT + file LICENSE'Writing 'LICENSE.md'Adding '^LICENSE\\.md$' to '.Rbuildignore'Writing 'LICENSE'

all is fine and dandy.

I repeated the test using Rstudio (Version 1.1.383) and the error is now gone, that is, use_mit_license works as intended. I wonder if there is something extra that Rstudio does in the background that is not replicated in console ("vanilla") R.

 devtools::session_info()
Session info ------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.3 (2017-11-30)
 system   x86_64, linux-gnu           
 ui       X11                         
 language en_US                       
 collate  en_US.UTF-8                 
 tz       Europe/Berlin               
 date     2018-01-25                  

Packages ----------------------------------------------------------------------
 package    * version    date       source                          
 assertthat   0.2.0      2017-04-11 CRAN (R 3.4.1)                  
 backports    1.1.2      2017-12-13 cran (@1.1.2)                   
 base       * 3.4.3      2017-12-01 local                           
 clisymbols   1.2.0      2017-05-21 cran (@1.2.0)                   
 compiler     3.4.3      2017-12-01 local                           
 crayon       1.3.4      2017-09-16 CRAN (R 3.4.1)                  
 datasets   * 3.4.3      2017-12-01 local                           
 desc         1.1.1      2017-08-03 cran (@1.1.1)                   
 devtools     1.13.4     2017-11-09 CRAN (R 3.4.2)                  
 digest       0.6.14     2018-01-14 CRAN (R 3.4.3)                  
 graphics   * 3.4.3      2017-12-01 local                           
 grDevices  * 3.4.3      2017-12-01 local                           
 memoise      1.1.0      2017-04-21 CRAN (R 3.4.1)                  
 methods    * 3.4.3      2017-12-01 local                           
 R6           2.2.2      2017-06-17 CRAN (R 3.4.1)                  
 rprojroot    1.3-2      2018-01-03 CRAN (R 3.4.3)                  
 rstudioapi   0.7        2017-09-07 CRAN (R 3.4.1)                  
 stats      * 3.4.3      2017-12-01 local                           
 usethis    * 1.2.0      2018-01-19 CRAN (R 3.4.3)                  
 utils      * 3.4.3      2017-12-01 local                           
 whisker      0.3-2      2013-04-28 CRAN (R 3.4.1)                  
 withr        2.1.1.9000 2018-01-02 Github (jimhester/withr@df18523)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions