Skip to content

Commit

Permalink
handle strange behaviour re: symlinks becoming empty directories
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Apr 17, 2015
1 parent 11b26c5 commit 42b76ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: packrat
Type: Package
Title: A Dependency Management System for Projects and their R Package
Dependencies
Version: 0.4.3-18
Version: 0.4.3-19
Date: 2014-09-02
Author: Kevin Ushey, Jonathan McPherson, Joe Cheng, JJ Allaire
Maintainer: Kevin Ushey <kevin@rstudio.com>
Expand Down
8 changes: 7 additions & 1 deletion R/library-support.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ symlinkSystemPackages <- function(project = NULL) {

# Bash old symlinks just to ensure this session will be non-stale.
# TODO: What if multiple R sessions want to run with a single packrat project?
if (file.exists(to)) unlink(to)
if (file.exists(to) && is.symlink(to))
unlink(to)

# TODO: For some reason, empty directories rather than junction points can
# get generated on Windows.
if (file.exists(to))
unlink(to, recursive = TRUE)

symlink(from, to)
}, logical(1)))
Expand Down
2 changes: 1 addition & 1 deletion inst/resources/init-rprofile.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#### -- Packrat Autoloader (version 0.4.3-18) -- ####
#### -- Packrat Autoloader (version 0.4.3-19) -- ####
source("packrat/init.R")
#### -- End Packrat Autoloader -- ####
2 changes: 1 addition & 1 deletion inst/resources/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ local({
## an 'installed from source' version

## -- InstallAgent -- ##
installAgent <- 'InstallAgent: packrat 0.4.3-18'
installAgent <- 'InstallAgent: packrat 0.4.3-19'

## -- InstallSource -- ##
installSource <- 'InstallSource: source'
Expand Down

0 comments on commit 42b76ad

Please sign in to comment.