@@ -118,7 +118,7 @@ var runCommand = &cli.Command{
118118 } else {
119119 homeDir , err := os .UserHomeDir ()
120120 if err != nil {
121- if exists , err := util .FileSystem . Exists ( ctx . Context , path .Join (homeDir , "lib" , "hugot" , "onnxruntime.so" )); err != nil && exists {
121+ if exists , err := util .FileExists ( path .Join (homeDir , "lib" , "hugot" , "onnxruntime.so" )); err != nil && exists {
122122 opts = append (opts , options .WithOnnxLibraryPath (path .Join (homeDir , "lib" , "hugot" , "onnxruntime.so" )))
123123 }
124124 }
@@ -137,14 +137,14 @@ var runCommand = &cli.Command{
137137 }()
138138
139139 // is the model a full path to a model
140- ok , err := util .FileSystem . Exists ( ctx . Context , modelPath )
140+ ok , err := util .FileExists ( modelPath )
141141 if err != nil {
142142 return err
143143 }
144144 if ! ok {
145145 // is the model the name of a model previously downloaded
146146 downloadedModelName := strings .Replace (modelPath , "/" , "_" , - 1 )
147- ok , err = util .FileSystem . Exists ( ctx . Context , util .PathJoinSafe (modelsDir , downloadedModelName ))
147+ ok , err = util .FileExists ( util .PathJoinSafe (modelsDir , downloadedModelName ))
148148 if err != nil {
149149 return err
150150 }
@@ -155,7 +155,7 @@ var runCommand = &cli.Command{
155155 if strings .Contains (modelPath , ":" ) {
156156 return fmt .Errorf ("filters with : are currently not supported" )
157157 }
158- err = util .FileSystem . Create ( context . Background (), modelsDir , os . ModePerm , true )
158+ err = util .CreateFile ( modelsDir , true )
159159 if err != nil {
160160 return err
161161 }
@@ -229,7 +229,7 @@ var runCommand = &cli.Command{
229229
230230 if outputPath != "" {
231231 dest := util .PathJoinSafe (outputPath , fmt .Sprintf ("result-%d.jsonl" , i ))
232- writer , err = util .FileSystem . NewWriter ( ctx . Context , dest , os . ModePerm )
232+ writer , err = util .NewFileWriter ( dest , "application/json" )
233233 if err != nil {
234234 return err
235235 }
@@ -258,7 +258,7 @@ var runCommand = &cli.Command{
258258
259259 // read inputs
260260
261- exists , err := util .FileSystem . Exists ( ctx . Context , inputPath )
261+ exists , err := util .FileExists ( inputPath )
262262 if err != nil {
263263 return err
264264 }
@@ -276,7 +276,7 @@ var runCommand = &cli.Command{
276276 return true , nil
277277 }
278278
279- err := util .FileSystem . Walk (ctx .Context , inputPath , fileWalker )
279+ err := util .WalkDir () (ctx .Context , inputPath , fileWalker )
280280 if err != nil {
281281 return err
282282 }
0 commit comments