File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
- schemaVersion : 2.0 .0
1
+ schemaVersion : 2.1 .0
2
2
metadata :
3
3
name : nodejs
4
4
version : 1.0.0
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
+ "os"
5
6
"reflect"
7
+ "strings"
6
8
7
9
devfilepkg "github.com/devfile/library/pkg/devfile"
8
10
"github.com/devfile/library/pkg/devfile/parser"
@@ -11,7 +13,20 @@ import (
11
13
)
12
14
13
15
func main () {
14
- devfile , err := ParseDevfile ("./devfile.yaml" )
16
+ var devfile parser.DevfileObj
17
+ var err error
18
+ if len (os .Args ) > 1 {
19
+ if strings .HasPrefix (os .Args [1 ], "http" ) {
20
+ devfile , err = devfilepkg .ParseFromURLAndValidate (os .Args [1 ])
21
+ } else {
22
+ devfile , err = ParseDevfile (os .Args [1 ])
23
+ }
24
+ fmt .Println ("parsing devfile from " + os .Args [1 ])
25
+
26
+ } else {
27
+ devfile , err = ParseDevfile ("devfile.yaml" )
28
+ fmt .Println ("parsing devfile from " + devfile .Ctx .GetAbsPath ())
29
+ }
15
30
if err != nil {
16
31
fmt .Println (err )
17
32
} else {
You can’t perform that action at this time.
0 commit comments