Skip to content

Commit

Permalink
Put module cache in home directory on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
tvald committed Jul 7, 2018
1 parent d0ebd8e commit 619b8e1
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"log"
"os"
"path/filepath"
"runtime"

"github.com/gruntwork-io/terragrunt/errors"
"github.com/gruntwork-io/terragrunt/util"
Expand Down Expand Up @@ -98,13 +97,6 @@ func NewTerragruntOptions(terragruntConfigPath string) (*TerragruntOptions, erro
}

downloadDir := filepath.Join(homedir, ".terragrunt")
// On some versions of Windows, the default temp dir is a fairly long path (e.g. C:/Users/JONDOE~1/AppData/Local/Temp/2/).
// This is a problem because Windows also limits path lengths to 260 characters, and with nested folders and hashed folder names
// (e.g. from running terraform get), you can hit that limit pretty quickly. Therefore, we try to set the temporary download
// folder to something slightly shorter, but still reasonable.
if runtime.GOOS == "windows" {
downloadDir = `C:\\Windows\\Temp\\terragrunt`
}

return &TerragruntOptions{
TerragruntConfigPath: terragruntConfigPath,
Expand Down

0 comments on commit 619b8e1

Please sign in to comment.