Skip to content

Commit 624d9e7

Browse files
authored
Merge pull request #293 from Bedrock-OSS/develop
Update 1.4.1
2 parents cea0f11 + fd8b410 commit 624d9e7

File tree

6 files changed

+37
-5
lines changed

6 files changed

+37
-5
lines changed

local_install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go install -ldflags="-X main.commit=$(git rev-parse HEAD)" github.com/Bedrock-OSS/regolith

main.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,23 @@ func main() {
199199
eval.Init()
200200

201201
// Root command
202+
versionTitle := "Regolith "
203+
if buildSource != "DEV" {
204+
versionTitle += version
205+
} else {
206+
versionTitle += "Dev Build"
207+
}
208+
if commit != "" {
209+
versionTitle += " (#" + commit[0:7]
210+
if date != "" {
211+
versionTitle += " built at " + date
212+
}
213+
versionTitle += ")"
214+
}
202215
var rootCmd = &cobra.Command{
203216
Use: "regolith",
204217
Short: "Addon Compiler for the Bedrock Edition of Minecraft",
205-
Long: regolithDesc,
218+
Long: versionTitle + regolithDesc,
206219
Version: version,
207220
}
208221
subcommands := make([]*cobra.Command, 0)

regolith/export.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func ExportProject(ctx RunContext) error {
277277
var exportedFilterNames []string
278278
for filter := range profile.Filters {
279279
filter := profile.Filters[filter]
280-
usingDataPath, err := filter.IsUsingDataExport(dotRegolithPath)
280+
usingDataPath, err := filter.IsUsingDataExport(dotRegolithPath, ctx)
281281
if err != nil {
282282
return burrito.WrapErrorf(
283283
err,

regolith/filter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ type FilterRunner interface {
215215

216216
// IsUsingDataExport returns whether the filter wants its data to be
217217
// exported back to the data folder after running the profile.
218-
IsUsingDataExport(dotRegolithPath string) (bool, error)
218+
IsUsingDataExport(dotRegolithPath string, ctx RunContext) (bool, error)
219219
}
220220

221221
func (f *Filter) CopyArguments(parent *RemoteFilter) {
@@ -256,7 +256,7 @@ func (f *Filter) IsDisabled(ctx RunContext) (bool, error) {
256256
return false, nil
257257
}
258258

259-
func (f *Filter) IsUsingDataExport(_ string) (bool, error) {
259+
func (f *Filter) IsUsingDataExport(_ string, _ RunContext) (bool, error) {
260260
return false, nil
261261
}
262262

regolith/filter_profile.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,21 @@ func (f *ProfileFilter) Check(context RunContext) error {
4040
profile, f.Profile, *context.Config, &context,
4141
context.DotRegolithPath)
4242
}
43+
44+
func (f *ProfileFilter) IsUsingDataExport(dotRegolithPath string, ctx RunContext) (bool, error) {
45+
profile := ctx.Config.Profiles[f.Profile]
46+
for filter := range profile.Filters {
47+
filter := profile.Filters[filter]
48+
usingDataPath, err := filter.IsUsingDataExport(dotRegolithPath, ctx)
49+
if err != nil {
50+
return false, burrito.WrapErrorf(
51+
err,
52+
"Failed to check if profile is using data export.\n"+
53+
"Profile: %s", f.Profile)
54+
}
55+
if usingDataPath {
56+
return true, nil
57+
}
58+
}
59+
return false, nil
60+
}

regolith/filter_remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (f *RemoteFilter) GetCachedVersion(dotRegolithPath string) (*string, error)
308308
return &version, nil
309309
}
310310

311-
func (f *RemoteFilter) IsUsingDataExport(dotRegolithPath string) (bool, error) {
311+
func (f *RemoteFilter) IsUsingDataExport(dotRegolithPath string, _ RunContext) (bool, error) {
312312
// Load the filter.json file
313313
filterJsonPath := filepath.Join(f.GetDownloadPath(dotRegolithPath), "filter.json")
314314
file, err := os.ReadFile(filterJsonPath)

0 commit comments

Comments
 (0)