File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ package context
22
33import (
44 context2 "context"
5+ "os"
6+ "path"
7+ "path/filepath"
8+ "runtime"
9+ "strings"
10+
511 "github.com/loft-sh/devspace/pkg/devspace/config"
612 "github.com/loft-sh/devspace/pkg/devspace/dependency/types"
713 "github.com/loft-sh/devspace/pkg/devspace/kubectl"
@@ -11,11 +17,6 @@ import (
1117 "github.com/loft-sh/devspace/pkg/util/tomb"
1218 "github.com/pkg/errors"
1319 "mvdan.cc/sh/v3/expand"
14- "os"
15- "path"
16- "path/filepath"
17- "runtime"
18- "strings"
1920)
2021
2122func NewContext (ctx context2.Context , variables map [string ]interface {}, log log.Logger ) Context {
@@ -198,6 +199,15 @@ func (c *context) ResolvePath(relPath string) string {
198199 return path .Clean (relPath )
199200 }
200201
202+ homeDir , err := os .UserHomeDir ()
203+ if err == nil {
204+ if relPath == "~" {
205+ return homeDir
206+ } else if strings .HasPrefix (relPath , "~/" ) {
207+ return path .Clean (filepath .Join (homeDir , relPath [2 :]))
208+ }
209+ }
210+
201211 outPath := path .Join (filepath .ToSlash (c .workingDir ), relPath )
202212 if ! filepath .IsAbs (outPath ) {
203213 return c .workingDir
You can’t perform that action at this time.
0 commit comments