@@ -85,7 +85,7 @@ func run() error {
8585 if err != nil {
8686 return err
8787 }
88- skillSpectorFixture , err := prettyJSON (skillSpectorInput )
88+ skillSpectorFixture , err := json . MarshalIndent (skillSpectorInput , "" , " " )
8989 if err != nil {
9090 return err
9191 }
@@ -116,21 +116,16 @@ func run() error {
116116 if err != nil {
117117 return err
118118 }
119- if * out != "" {
120- if err := os .MkdirAll (filepath .Dir (* out ), 0o755 ); err != nil {
121- return err
122- }
123- if err := os .WriteFile (* out , append (encoded , '\n' ), 0o644 ); err != nil {
124- return err
125- }
119+ if err := writeOptionalFile (* out , append (encoded , '\n' )); err != nil {
120+ return err
126121 }
127122 if err := writeOptionalFile (* outSystemPrompt , []byte (systemPrompt )); err != nil {
128123 return err
129124 }
130125 if err := writeOptionalFile (* outPrompt , []byte (promptTemplate )); err != nil {
131126 return err
132127 }
133- if err := writeOptionalFile (* outSkillSpectorResult , [] byte ( skillSpectorFixture ) ); err != nil {
128+ if err := writeOptionalFile (* outSkillSpectorResult , skillSpectorFixture ); err != nil {
134129 return err
135130 }
136131 if err := writeOptionalFile (* outOutputSchema , schema ); err != nil {
@@ -258,12 +253,7 @@ func parityFixtureContext(fixture parityFixture) (json.RawMessage, error) {
258253}
259254
260255func embeddedClawHubProfileFiles () (string , []byte , error ) {
261- dir , err := os .MkdirTemp ("" , "clawscan-profile-parity-*" )
262- if err != nil {
263- return "" , nil , err
264- }
265- defer os .RemoveAll (dir )
266- opts , err := profiles .ResolveArgs ([]string {"./skill" , "--profile" , "clawhub" }, dir )
256+ opts , err := profiles .ResolveArgs ([]string {"./skill" , "--profile" , "clawhub" }, "." )
267257 if err != nil {
268258 return "" , nil , err
269259 }
@@ -366,14 +356,6 @@ func buildPromptTemplate(prompt string) (string, error) {
366356 return prompt [:contentStart ] + placeholder + prompt [contentEnd :], nil
367357}
368358
369- func prettyJSON (value any ) (string , error ) {
370- raw , err := json .MarshalIndent (value , "" , " " )
371- if err != nil {
372- return "" , err
373- }
374- return string (raw ), nil
375- }
376-
377359func resolveClawHubDir (path string ) (string , error ) {
378360 return filepath .Abs (path )
379361}
0 commit comments