-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #693 from CircleCI-Public/remove-packr
Remove uses of packr
- Loading branch information
Showing
16 changed files
with
20 additions
and
499 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,21 @@ | ||
package data | ||
|
||
import ( | ||
packr "github.com/gobuffalo/packr/v2" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
// YML maps the YAML found in _data/data.yml | ||
// Be sure to update this type when you modify the structure of that file! | ||
type YML struct { | ||
type DataBag struct { | ||
Links struct { | ||
CLIDocs string `yaml:"cli_docs"` | ||
OrbDocs string `yaml:"orb_docs"` | ||
NewAPIToken string `yaml:"new_api_token"` | ||
} `yaml:"links"` | ||
} | ||
|
||
// LoadData should be called once to decode the YAML into YML. | ||
func LoadData() (*YML, error) { | ||
var ( | ||
bts []byte | ||
err error | ||
) | ||
|
||
d := &YML{} | ||
box := packr.New("circleci-cli-box", "../_data") | ||
|
||
bts, err = box.Find("data.yml") | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
err = yaml.Unmarshal(bts, &d) | ||
if err != nil { | ||
return nil, err | ||
CLIDocs string | ||
OrbDocs string | ||
NewAPIToken string | ||
} | ||
} | ||
|
||
return d, nil | ||
var Data = DataBag{ | ||
Links: struct { | ||
CLIDocs string | ||
OrbDocs string | ||
NewAPIToken string | ||
}{ | ||
CLIDocs: "https://circleci.com/docs/2.0/local-cli/", | ||
OrbDocs: "https://circleci.com/docs/2.0/orb-intro/", | ||
NewAPIToken: "https://circleci.com/account/api", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.