Skip to content

Commit

Permalink
Merge pull request #215 from ibuildthecloud/completiontext
Browse files Browse the repository at this point in the history
fix: assemble format issues
  • Loading branch information
ibuildthecloud authored Apr 3, 2024
2 parents 9845f06 + 8ee934f commit d79063b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package loader
import (
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -78,12 +76,8 @@ func loadLocal(base *source, name string) (*source, bool, error) {
func loadProgram(data []byte, into *types.Program, targetToolName string) (types.Tool, error) {
var (
ext types.Program
id string
)

summed := sha256.Sum256(data)
id = "@" + hex.EncodeToString(summed[:])[:12]

if err := json.Unmarshal(data[len(assemble.Header):], &ext); err != nil {
return types.Tool{}, err
}
Expand All @@ -93,15 +87,10 @@ func loadProgram(data []byte, into *types.Program, targetToolName string) (types
if builtinTool, ok := builtin.Builtin(k); ok {
v = builtinTool
}

for tk, tv := range v.ToolMapping {
v.ToolMapping[tk] = tv + id
}
v.ID = k + id
into.ToolSet[v.ID] = v
into.ToolSet[k] = v
}

tool := into.ToolSet[ext.EntryToolID+id]
tool := into.ToolSet[ext.EntryToolID]
if targetToolName == "" {
return tool, nil
}
Expand Down

0 comments on commit d79063b

Please sign in to comment.