@@ -17,7 +17,7 @@ import (
17
17
// An HTTPNode is a node that reads a Taskfile from a remote location via HTTP.
18
18
type HTTPNode struct {
19
19
* baseNode
20
- URL * url.URL // stores url pointing actual remote file. (e.g. with Taskfile.yml)
20
+ url * url.URL // stores url pointing actual remote file. (e.g. with Taskfile.yml)
21
21
}
22
22
23
23
func NewHTTPNode (
@@ -36,20 +36,20 @@ func NewHTTPNode(
36
36
}
37
37
return & HTTPNode {
38
38
baseNode : base ,
39
- URL : url ,
39
+ url : url ,
40
40
}, nil
41
41
}
42
42
43
43
func (node * HTTPNode ) Location () string {
44
- return node .URL .Redacted ()
44
+ return node .url .Redacted ()
45
45
}
46
46
47
47
func (node * HTTPNode ) Read () ([]byte , error ) {
48
48
return node .ReadContext (context .Background ())
49
49
}
50
50
51
51
func (node * HTTPNode ) ReadContext (ctx context.Context ) ([]byte , error ) {
52
- url , err := RemoteExists (ctx , * node .URL )
52
+ url , err := RemoteExists (ctx , * node .url )
53
53
if err != nil {
54
54
return nil , err
55
55
}
@@ -87,7 +87,7 @@ func (node *HTTPNode) ResolveEntrypoint(entrypoint string) (string, error) {
87
87
if err != nil {
88
88
return "" , err
89
89
}
90
- return node .URL .ResolveReference (ref ).String (), nil
90
+ return node .url .ResolveReference (ref ).String (), nil
91
91
}
92
92
93
93
func (node * HTTPNode ) ResolveDir (dir string ) (string , error ) {
@@ -112,12 +112,12 @@ func (node *HTTPNode) ResolveDir(dir string) (string, error) {
112
112
113
113
func (node * HTTPNode ) CacheKey () string {
114
114
checksum := strings .TrimRight (checksum ([]byte (node .Location ())), "=" )
115
- dir , filename := filepath .Split (node .URL .Path )
115
+ dir , filename := filepath .Split (node .url .Path )
116
116
lastDir := filepath .Base (dir )
117
117
prefix := filename
118
118
// Means it's not "", nor "." nor "/", so it's a valid directory
119
119
if len (lastDir ) > 1 {
120
120
prefix = fmt .Sprintf ("%s.%s" , lastDir , filename )
121
121
}
122
- return fmt .Sprintf ("http.%s.%s.%s" , node .URL .Host , prefix , checksum )
122
+ return fmt .Sprintf ("http.%s.%s.%s" , node .url .Host , prefix , checksum )
123
123
}
0 commit comments